可能是一个荒谬的问题,但有没有办法从控制器类本身获取实际的控制器名称?
喜欢
class SomeController extends Zend_Controller_Action { public function init() { $controllerName = $this -> getControllerName(); // And get "Some" as a output } }
public function init() { echo Zend_Controller_Front::getInstance()->getRequest()->getControllerName(); }