在控制器里 $name = $this->getId(); $this->id; Yii::app()->getController()->id// controller名 $name = $this->getAction()->id; // action 在视图里 $name = Yii::app()->controller->id; // controller $name = $this->getAction()->getId(); // action