question about createController() in CWebApplication

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 ?

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.”

thank you very much.

sorry, how to set the path?

for example if i’m in


and controller is in


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?