How to use built-in jquery core? what should I publish and where?
Two ways:
- Call the following method at any place of your page:
Yii::app()->clientScript->registerCoreScript('jquery');
- Call the following in the head section of your page:
<?php echo CHtml::coreScript('jquery'); ?>
This actually produces an error:
<?php echo CHtml::coreScript('jquery'); ?>
There is no coreScript method in CHtml.
In the new versions you should do this:
Yii::app()->clientScript->registerCoreScript('jquery');