system
(system)
December 3, 2008, 3:52am
1
CConfiguration::createObject($config) only accept one parameter ,but
the following line from createController() in CWebApplication class.
return CConfiguration::createObject($this->controllerMap[$id],$id);
it is correct? or not? and what is the meaning of second parameter $id ?
qiang
(Qiang Xue)
December 3, 2008, 4:09am
2
This is correct. According to the API doc http://www.yiiframew…n#createObject, “Any additional parameters passed to this method will be passed to the constructor of the object being created.”
sorry, how to set the path?
for example if i’m in
/var/www/tasker/task/task-new.php
and controller is in
/var/www/tasker/protected/controllers/TaskController
can i use :
$mycontroller = CWebApplication->createController(’../protected/controllers/TaskController’);
?
i obtain the error :
Parse error: syntax error, unexpected T_OBJECT_OPERATOR in /var/www/tasker/task/task-new.php on line 15
can you help me please?
thanks