<link rel="stylesheet" href="/css/style.php"/> <script src="/css/script.php"></script>
you could also tell php to parse js files, but that would decrease site performance since the js files won’t be cached by the browser anymore.
var = <?php echo $myvar; ?>;
Is there another way to do it?
Thanks, if it is not too much asking: can you give me an example?
the example would be something like this:
Yii::app()->clientScript->registerScript('KadastraleCodeWidget_script', 'var myPhpVar = ' . $myPhpVar . ';', CClientScript::POS_HEAD); Yii::app()->clientScript->registerScriptFile('js/scriptfile_that_needs_the_vars.js');
Thanks for your answer. I have a question:
What is the difference between app()->getClientScript and app()->clientScript?
well, as far as I know is the result equal, only app()->clientScript uses the magic __get() method while app()->getClientScript() does not