Yii::app()->clientScript->registerCoreScript('jquery'); gives error in

Trying to include jquery, I added the following line to index.php at the bottom.



// change the following paths if necessary



// remove the following line when in production mode

defined('YII_DEBUG') or define('YII_DEBUG',true);





This however results in an error at the end of the page.

Fatal error: Call to a member function recordCachingAction() on a non-object in E:xampphtdocsyiiframeworkwebCClientScript.php on line 279

Anyone got an idea what may be causing it? The jquery library seems to load just fine as tested with







and urls fade out just fine.

This is because you are calling this outside of the application lifecycle.

The method requires the existence of a current controller instance.

Ah, but where do I include it then properly if I want it to be part of the whole site?

Put it in your layout view file.

I want to write an extension extends a CLogRoute class, but in render I need to use jQuery functions.

How I can register jquery script inside an extension?