Exemplo n.º 1
0
 /**
  * Prepare render hook.
  *
  * @return  void
  */
 protected function prepareRender()
 {
     parent::prepareRender();
     $data = $this->getData();
     $data->item = $this->get('Item');
     $data->state = $this->get('State');
     if ($errors = $data->state->get('errors')) {
         $this->flash($errors);
     }
 }
Exemplo n.º 2
0
 /**
  * Prepare render hook.
  *
  * @return  void
  */
 protected function prepareRender()
 {
     parent::prepareRender();
     $this['item'] = $this['item'] ?: $this->get('Item');
     if (property_exists($this['item'], 'catid')) {
         $this['state']->set('category.id', $this['item']->catid);
     }
     if ($errors = $this['state']->get('errors')) {
         $this->addMessage($errors);
     }
 }
Exemplo n.º 3
0
 /**
  * Prepare render hook.
  *
  * @return  void
  */
 protected function prepareRender()
 {
     parent::prepareRender();
     $this['items'] = $this['items'] ?: $this->get('Items');
     $this['pagination'] = $this['pagination'] ?: $this->get('Pagination');
     if ($errors = $this['state']->get('errors')) {
         $this->addMessage($errors);
     }
     // B/C for old templates
     foreach ($this['items'] as $item) {
         $pkName = strtolower($this->viewItem) . '_id';
         $item->{$pkName} = isset($item->id) ? $item->id : null;
     }
 }
Exemplo n.º 4
0
 /**
  * Method to instantiate the view.
  *
  * @param Model             $model     The model object.
  * @param Container         $container DI Container.
  * @param array             $config    View config.
  * @param \SplPriorityQueue $paths     Paths queue.
  */
 public function __construct(Model $model = null, Container $container = null, $config = array(), \SplPriorityQueue $paths = null)
 {
     $this->engine = new PhpEngine();
     parent::__construct($model, $container, $config, $paths);
 }