Jquery Mobile and Yii

im having problem with Yii and jQuery mobile. The problem is that jQuery mobile only use js files from rel="external" link, that are inside div with data-role="page". Yii generates active form js at the end of div or in the header

I tried to put inside div tag


    <script src='lala/js.js' type = "text/javascipt"></script>

an i could bind the js and css with :

js.js:




    $('div').live('pagebeforeshow', function(event, ui){

    $("head").append("<link>");

        css = $("head").children(":last");

        css.attr({

          rel:  "stylesheet",

          type: "text/css",

          href: "/site/css/mobile/mobile.css"

        });

         $.getScript("/site/js/fancyForm_qe.js", function(){

             //some other stuff

    	 );

         });

       $('.successMessage').hide();

    });

the problem is that i want to use YII functions to add css and js.Any solutions?

I’m interested as well

Oh, finally find out how to do it:


$markup = '';

Yii::app()->clientScript->render($markup);

echo($markup);

Hello, could you please explain what is the approaching you are doing to make mobile apps using Yii + jquery mobile?

Thanks in advance!