Exemplo n.º 1
0
 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();
 }
Exemplo n.º 2
0
 /**
  * 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;
 }
Exemplo n.º 3
0
 /**
  * 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();
 }
Exemplo n.º 4
0
 /**
  * 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;
 }