Я нашел этот код here, пытаясь понять, что делает actionstack и почему они должны быть настолько плохими. Я думал, что actionstack - это всего лишь один тип помощника действий (точно так же, как flashmessenger или redirector или ViewRenderer).Как это сделать без actionstack
Но так или иначе, кто-нибудь понимает, что делает этот код и как делать то же самое без действия?
class MyController_Action extends Zend_Controller_Action {
function init() {
/** you might not want to add to the stack if it's a XmlHttpRequest */
if(!$this->getRequest()->isXmlHttpRequest()) {
$this->_helper->actionStack('left', 'somecontroller', 'somemodule');
$this->_helper->actionStack('center', 'somecontroller', 'somemodule');
$this->_helper->actionStack('right', 'somecontroller', 'somemodule');
}
}
class MyController extends MyController_Action {
function indexAction() {
// do something
}
}
class SomecontrollerController extends MyController_Action {
function leftAction() {
// do something
$this->_helper->viewRenderer->setResponseSegment('left_container');
}
function centerAction() {
// do something
$this->_helper->viewRenderer->setResponseSegment('center_container');
}
function rightAction() {
// do something
$this->_helper->viewRenderer->setResponseSegment('right_container');
}
}
Еще одна замечательная статья о практическом ZF от проекта –