在View(CakePHP)中,获取当前控制器的正确方法是什么? [英] In View(CakePHP), the proper way to get current controller?
本文介绍了在View(CakePHP)中,获取当前控制器的正确方法是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
在视图中,我可以使用
$this->action
但是,我无法通过
$this->controller
在View中获取当前控制器的正确方法是什么?
What is the proper way to get current controller in View?
推荐答案
使用 $ this-> params ['controller']
您可以执行 debug($ this-> params)
来查看其他控制器可用变量。
You can do a debug($this->params)
to see other available variables.
这篇关于在View(CakePHP)中,获取当前控制器的正确方法是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文