In View(CakePHP), the proper way to get current controller?

前端 未结 8 847
伪装坚强ぢ
伪装坚强ぢ 2021-02-02 07:36

In View, I can get action by using

$this->action

But, I cannot get controller name by

$this->controller
8条回答
  •  走了就别回头了
    2021-02-02 08:20

    Use $this->params['controller'] to get the current controller.

    You can do a debug($this->params) to see other available variables.

提交回复
热议问题