Yii里获取当前controller和action的id
在控制器里
$name = $this->getId();  // controller
$name = $action->id;  // action

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

相关文章:

  • 2021-08-03
  • 2022-12-23
猜你喜欢
  • 2022-02-22
  • 2021-05-29
  • 2021-12-28
  • 2022-12-23
  • 2022-02-15
  • 2021-07-28
  • 2021-08-14
相关资源
相似解决方案