Пример #1
0
 /**
  * ctor-function to initialize basic controller behaviour
  */
 public function __construct()
 {
     $server = php_sapi_name();
     if ('cli' !== $server) {
         $this->_request = new Request\Http();
         $this->_response = new Response\Http($this->_request);
     }
     $className = get_class($this);
     $classArray = explode('\\', $className);
     $module = array_shift($classArray);
     $this->view = Mvc\ModuleSetup::getInstance($module)->get(['View' => 'config']);
     $this->view->setRequest($this->getRequest());
     $this->_model = new Mvc\Model\ViewContainer($this->view);
     $this->init();
 }