/ Published in: PHP

Este código nos permite incluir archivos JS y CSS en los views
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
$baseUrl = Yii::app()->baseUrl; $cs = Yii::app()->getClientScript(); $cs->registerScriptFile($baseUrl.'/js/yourscript.js'); $cs->registerCssFile($baseUrl.'/css/yourcss.css'); // Para incluir código directamente, en lugar de $cs->registerScript( 'my-hello-world-1', 'var greetings = "Hello" + " " + "World"; alert(greetings);', CClientScript::POS_END );
Comments
