예제 #1
0
 public function renderEdit()
 {
     $categoryId = $this->getInt('id');
     $form = new Form('editCategory', '');
     $form->bindMapper(new Category($categoryId));
     return $this->createView(new CategoryForm("Edit Category", $form));
 }
예제 #2
0
 public function renderEdit()
 {
     $platformId = $this->getInt('id');
     $form = new Form('editPlatform', '');
     $form->bindMapper(new Platform($platformId));
     return new PlatformForm("Edit Platform", $form);
 }
예제 #3
0
 public function renderEdit()
 {
     $userId = $this->getInt('id');
     $form = new Form('editUser', '');
     $form->bindMapper(new User($userId));
     return new UserForm("Edit User", $form);
 }
예제 #4
0
파일: Login.php 프로젝트: qubes/support
 public function render()
 {
     $form = new Form('login');
     $form->addTextElement('username');
     $form->addPasswordElement('password');
     $form->addSubmitElement('Login');
     $alert = '';
     if (Session::getFlash('msg')) {
         $alert = new HtmlElement('div', ['class' => 'alert alert-error'], Session::getFlash('msg'));
     }
     return new RenderGroup('<h1>Please Login</h1>', $alert, $form);
 }
예제 #5
0
파일: VideoForm.php 프로젝트: qubes/support
 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');
     }
 }
예제 #6
0
파일: DeferoForm.php 프로젝트: qubes/defero
 protected function _postBind()
 {
     $this->getElement("submit")->setType(FormElement::BUTTON)->addAttribute("class", "btn js-btn-loading")->addAttribute("data-loading-text", "Submitting");
     return parent::_postBind();
 }
예제 #7
0
 public function __construct()
 {
     parent::__construct('contact');
 }