I want to call a javascript function inside APIController in my yii projects over a repeated interval.
public function actionMytimer() {
Yii::app()->clientScript->registerCoreScript('jquery');
Yii::app()->clientScript->registerCoreScript('jquery.ui');
$hello = setInterval(test,1000);
function test(){
echo 'hellooo interval';
}
}
Its very necessary for me to run the "test" method in a particular time interval.Is it possible?if not then any way to do this?. Please help.Thanks in advnc. Here is the current warning message :
Fatal error: Call to undefined function setInterval() in /Library/WebServer/Documents/MediaPult/protected/controllers/APIController.php on line 449