problems with clientScript

<?php $js = Yii::app()->getAssetManager()->publish(dirname(FILE))).’/js/’);

echo Yii::app()->clientScript->register($js.‘group.js’);


can you explain why this is not working?

im guessing its wrong to echo right, imean what actually does clientScript->register do? the docs are confusing, do i just call it and it does the magic


$cs = Yii::app()->getClientScript();

$jsDir = Yii::app()->getAssetManager()->publish(dirname(FILE))).’/js/’);


/*** $cs->registerCssFile($jsDir . ‘/myCoolTheme.css’); ***/

$cs->registerScriptFile($jsDir . ‘group.js’);


When you register the file to the clientScript, you’re adding it to the list of things which need to be published within the document. What kind of file you’re registering will determine where it’s placed in the document.

This link might be helpful: