/** * 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); } }
/** * 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); } }
/** * 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; } }
/** * 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); }