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