Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
在动作助手中,我可以使用$this->getRequest();
$this->getRequest();
视图助手有什么类似的吗?
您可以使用
Zend_Controller_Front::getInstance()->getRequest()
获取前端控制器,然后在您的视图中获取来自该控制器的请求。
尽管您应该使用控制器来接受请求,然后将正确的数据传递给视图。视图应该独立于请求并通过控制器解耦。这样做基本上破坏了 Zend Framework 的 MVC 实现。