public function renderEdit($id) { if ($id > 0) { $item = $this->items->get($id); if (!$item) { $this->flashMessage('No item with ID ' . $id, 'err'); $this->redirect('default'); } $this['form']->setDefaults($item); } $this->template->form = $this['form']; }