Exemplo n.º 1
0
 /**
  * assign all public members of the storage-object either to a (*default*) placeholder
  * or to a new member of the view
  * @param string $toPlaceholder
  * @return View
  */
 public function assignViewVars($toPlaceholder = 'content')
 {
     $placeholder = $this->_view->getPlaceholder();
     if ($placeholder !== $toPlaceholder) {
         $this->_view->setDefaultPlaceholder($toPlaceholder);
     }
     $this->_view->{$toPlaceholder} = $this->getData();
     return $this->_view;
 }
Exemplo n.º 2
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();
 }