Пример #1
0
 /**
  * _forward
  *
  * Calls to another action in the same controller
  * Updates the view pointing to the new action to enable its execution
  *
  * @param string $action
  *
  * @return mixed
  */
 protected function _forward($action)
 {
     $controller = $this->_request->getController();
     $viewPath = 'application/packages/' . str_replace('\\', DIRECTORY_SEPARATOR, $this->_package) . '/views/scripts/' . implode('/', array_slice(explode('\\', $this->_namespace), 1)) . '/';
     $this->_view->setFile($viewPath . $controller . DIRECTORY_SEPARATOR . $action . '.phtml');
     $actionName = $action . 'Action';
     return $this->{$actionName}();
 }
Пример #2
0
 /**
  * run
  *
  * FrontController is created with an initialized Container as a Service Locator
  * and then the application execution starts with FrontController run method
  */
 public function run()
 {
     $url = $this->_request->getExists('url') ? $this->_request->get('url') : '';
     $this->_request->setUrl($url);
     $this->_initDependencyInjectionContainer();
     $this->_frontController = new FrontController($this->_container);
     $this->_frontController->run();
 }