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

前端 未结 8 859
伪装坚强ぢ
伪装坚强ぢ 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:22

    I am using cakephp 3.2

    $this->params['controller'] - It is not working, showing error message as bellow..
    

    "Missing Helper"

    Following code is working properly in cakephp 3.2

    $this->request->params['controller'] - Working
    

提交回复
热议问题