:projectId and :projectID Please help me to understand
Posted 23 December 2010 - 10:43 PM
public $fixtures=array( 'projects'=>'Project', 'users'=>'User', 'projUsrAssign'=>':tbl_project_user_assignment', );
It says using ":" to indicate that this is a database table, and not an AR model class. - I understand
On Page 129:
$issueDataProvider=new CActiveDataProvider('Issue', array( 'criteria'=>array(
There is no explanation why ":" is being used. Could someone please explain this to me? I'm very confused. The only "projectId" variable is found in the filter function of IssueController. I'm not sure if :projectId is referencing that variable.
On Page 144, there is a line:
I'm not sure if this is a typo of :projectId or its another reference to some other places.
The code seems to work fine but I'm very confused.
Please help. Thank you.
Posted 24 December 2010 - 02:23 AM
Basicaly :projectid is a placeholder (not a variable) that is replaced with a value that you assign to it with 'params'
Posted 24 December 2010 - 05:02 AM
As per your question.. .you did not understand what is :projectid... and you thouth it's a variable...
So if you now understand the concept of binding... then you know that on this line
:projectId is just a placeholder... it does not have any value for now... a real value will be binded here...
and this line
Say that the value of $this->loadModel()->id should be placed instead of the placeholder :projectId
Hope it's clear now...
Posted 24 December 2010 - 11:12 AM
However, what would replace the place holder of :projectID ?
this (http://www.php.net/m...t.bindparam.php) suggests that a variable name same as the place holder will replace it's value?!
Is that the same in this case?