I am a complete newbie in the world of yii and doing my best to learn the framework as best as I can, while reading the book on Yii - 'Web Application Development Using Yii and PHP' by Jeffrey Winesett,
I came across :
'params'=>array(':projectId'=>$this->_project->id)
If anyone has read the book, can someone explain why do we use :projectId why not directly projectId? What does the ':' stand for? Is it the specific syntax or is it something php specific.
This was the exact code :
public function actionIndex()
{
$dataProvider=new CActiveDataProvider('Issue', array(
'criteria'=>array(
'condition'=>'project_id=:projectId',
'params'=>array(':projectId'=>$this->_project->id),
),
));
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
Any answer would be highly appreciated. Regards.