public function __construct(Zend_Controller_Request_Abstract $request, Zend_Controller_Response_Abstract $response, array $invokeArgs = array()) { $this->_request = $request; $this->_response = $response; App_Main::getControllerFrontend()->setAction($this); $this->_construct(); }
/** * Add hostname to session * * @param string $host * @return Core_Model_Session */ public function addHost($host) { if ($host === true) { if (!($host = App_Main::getControllerFrontend()->getRequest()->getHttpHost())) { return $this; } } if (!$host) { return $this; } $hosts = $this->getSessionHosts(); $hosts[$host] = true; $this->setSessionHosts($hosts); return $this; }
/** * Get the block HTML view * * @param string block name * @return string block HTML */ public function getBlockHtml($name) { if (!($layout = $this->getLayout()) && !($layout = App_Main::getControllerFrontend()->getLayout())) { return ''; } if (!($block = $layout->getBlock($name))) { return ''; } return $block->toHtml(); }
/** * Get route name used in request (ignore rewrite) * * @return string */ public function getRequestedRouteName() { if ($this->_requestedRouteName === null) { if ($this->_rewritedPathInfo !== null && isset($this->_rewritedPathInfo[0])) { $fronName = $this->_rewritedPathInfo[0]; $router = App_Main::getControllerFrontend()->getRouterByFrontName($fronName); $this->_requestedRouteName = $router->getRouteByFrontName($fronName); } else { // no rewritten path found, use default route name return $this->getRouteName(); } } return $this->_requestedRouteName; }