Yii cannot Instantiate controller
问题 As I see if we want to instantiate a Model (for example named Post ), we just have to call: $post = new Post(); Now, I also want to instantiate a Controller (for example named Post , and php file for this controller named PostController.php ). So I use this code: $postController = new PostController(); However, I get an error when running this code. I did some searching and found that it should be like the following to instantiate: $postController = Yii::app()->createController('post/index');