Usage Of Cwebapplication::createcontroller


        

public function actonTest()

{

	$controller = Yii::app()->createController('site/contact');

       	$controller->render('contact');

}



Error:




[size="1"]Fatal error: Call to a member function render() on a  non-object in  ...\protected\controllers\SiteController.php on  line [i]233[/i][/size]



createController() method:

What is wrong?

same error was discussed in this link

http://www.yiiframework.com/forum/index.php/topic/3799-function-geterrors/

<br /><br /><br />

What’s the related?




$controller = Yii::app() ->createController('controolerName');  $agreedController = $controller[0]; //first element of array return the instance controller. agreedController->run('actionName');

Thanks msoa, exactly what I was searching for