一聚教程网:一个值得你收藏的教程网站

热门教程

Yii框架如何获取当前controlle和action的id

时间:2022-06-25 00:54:37 编辑:袖梨 来源:一聚教程网

在控制器里

$name = $this->getId();  // controller

$name = $action->id;  // action

在视图里

$name = Yii::app()->controller->id;  // controller

$name = $this->getAction()->getId(); // action

热门栏目