如何获取当前的module controller action 等等

比如在


class Controller extends CController

{

	/**

	 * @var string the default layout for the controller view. Defaults to '//layouts/column1',

	 * meaning using a single column layout. See 'protected/views/layouts/column1.php'.

	 */

	public $layout='//layouts/column1';

	/**

	 * @var array context menu items. This property will be assigned to {@link CMenu::items}.

	 */

	public $menu=array();

	/**

	 * @var array the breadcrumbs of the current page. The value of this property will

	 * be assigned to {@link CBreadcrumbs::links}. Please refer to {@link CBreadcrumbs::links}

	 * for more details on how to specify this property.

	 */

	public $breadcrumbs=array();


        public function init()

	{

		echo Yii::app()->controller->id;

		

	}

}

Yii::app()->controller->id 为空


class AdminModule extends CWebModule

{

	public function init()

	{

		// this method is called when the module is being created

		// you may place code here to customize the module or the application


		// import the module-level models and components

		$this->setImport(array(

			'admin.models.*',

			'admin.components.*',

		));

           // 还有比如这里如何获取这些数据呢

		

	}

}

版本 v1.1.10

跟版本没多大关系

主要是时机 你在beforeAction 中就应该能访问到 或者在模块的beforeControllerAction 方法中(CWebApplication 也具有此方法)

这个要阅读源码才可以知道的 阅读CWebApplication::createController 的这个方法