public function renderEdit() { $platformId = $this->getInt('id'); $form = new Form('editPlatform', ''); $form->bindMapper(new Platform($platformId)); return new PlatformForm("Edit Platform", $form); }
public function renderEdit() { $userId = $this->getInt('id'); $form = new Form('editUser', ''); $form->bindMapper(new User($userId)); return new UserForm("Edit User", $form); }
public function renderEdit() { $categoryId = $this->getInt('id'); $form = new Form('editCategory', ''); $form->bindMapper(new Category($categoryId)); return $this->createView(new CategoryForm("Edit Category", $form)); }
public function bindMapper(RecordMapper $mapper) { if ($mapper instanceof Video) { parent::bindMapper($mapper); $this->getElement('title')->addAttribute('class', 'input-xxlarge'); $this->getElement('SubTitle')->addAttribute('class', 'input-xxlarge'); $this->getElement('slug')->addAttribute('class', 'input-xxlarge'); $this->getElement('imageUrl')->addAttribute('class', 'input-xxlarge'); $this->getElement('submit')->addAttribute('class', 'btn btn-success'); $this->getElement('url')->setLabel('Video URL')->addAttribute('class', 'input-xxlarge'); $options = Category::collection()->getKeyPair('id', 'title'); $this->addSelectElement('categoryId', $options, $mapper->categoryId); $this->getElement('categoryId')->setLabel('Category'); } else { throw new \Exception('Only Video Mapper can be bound to this form'); } }