当前位置: 首页>>代码示例>>PHP>>正文


PHP Forms\Form类代码示例

本文整理汇总了PHP中Venne\Forms\Form的典型用法代码示例。如果您正苦于以下问题:PHP Form类的具体用法?PHP Form怎么用?PHP Form使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


在下文中一共展示了Form类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: handleValidate

 public function handleValidate(Form $form)
 {
     if (!isset($this->sessionSection->captcha) || $form['_captcha']->value != $this->sessionSection->captcha) {
         $form->addError('Nesprávně opsaný obrázek, zkuste to prosím znovu');
         $form['_captcha']->setOption('description', Html::el('img')->src($this->getCaptchaBuilder()->inline()));
     }
 }
开发者ID:svobodni,项目名称:web,代码行数:7,代码来源:FormFactory.php

示例2: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addText('appId', 'App ID');
     $form->addText('secret', 'Secret');
     $form->addSelect('cookie', 'Use cookie', array(TRUE => 'yes', FALSE => 'no'));
     $form->addSaveButton('Save');
 }
开发者ID:venne,项目名称:social-module,代码行数:10,代码来源:SocialFormFactory.php

示例3: configure

 public function configure(Form $form)
 {
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $form->addOne('route')->setCurrentGroup($group)->addTextArea('notation', 'Notation', NULL, 4)->getControlPrototype()->attrs['class'] = 'input-block-level';
     $form->addSaveButton('Save');
 }
开发者ID:venne,项目名称:gallery-module,代码行数:7,代码来源:GalleryFormFactory.php

示例4: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addText('itemsPerPage', 'Items per page');
     $form->addManyToMany('pages', 'Pages');
     $form->addManyToMany('categories', 'Categories');
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:BlogFormFactory.php

示例5: configure

 /**
  * @param Form $form
  */
 protected function configure(Form $form)
 {
     $form->addText('name', 'Name');
     $form->addSelect('file', 'File')->setItems($this->templateManager->getLayouts());
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:LayoutFormFactory.php

示例6: formSuccess

 public function formSuccess(Form $form)
 {
     if ($form->isSubmitted() !== $form->getSaveButton()) {
         return;
     }
     $values = $form->values;
     $data = array('code' => 'K0ntrolaH3slem', 'jmeno' => $values['person'] == 'fyzicka' ? $values['fyzicka']['name'] : $values['pravnicka']['name'] . ' / ' . $values['pravnicka']['person'], 'narozeni' => $values['person'] == 'fyzicka' ? $values['fyzicka']['bornDate'] : $values['pravnicka']['IC'], 'ulice' => $values['street'], 'obec' => $values['city'], 'psc' => $values['psc'], 'email' => $values['email'], 'castka' => $values['money'] == 'other' ? $values['moneyOther'] : $values['money'], 'ip' => $this->httpRequest->remoteAddress);
     $params = '';
     foreach ($data as $key => $val) {
         $params .= '&' . $key . '=' . urlencode($val);
     }
     $params = ltrim($params, '&');
     $ch = curl_init();
     curl_setopt($ch, CURLOPT_URL, 'http://s-dary.zvara.cz/inject.php');
     curl_setopt($ch, CURLOPT_POST, count($data));
     curl_setopt($ch, CURLOPT_POSTFIELDS, $params);
     curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);
     $result = curl_exec($ch);
     $status = curl_getinfo($ch, CURLINFO_HTTP_CODE);
     curl_close($ch);
     if ($status == 200) {
         $this->flashMessage('Děkujeme, částku prosím uhraďte na náš transparentní účet s variabilním symbolem ' . $result, 'success');
     } elseif ($status == 403) {
         $this->flashMessage('Server nemá povolení k provedení akce. Prosím kontaktujte administrátora. ', 'warning');
     } else {
         $this->flashMessage('Nastala chyba při ukládání, zopakujte prosím akci později', 'warning');
     }
     $this->redirect('this');
 }
开发者ID:svobodni,项目名称:web,代码行数:29,代码来源:RoutePresenter.php

示例7: configure

 public function configure(Form $form)
 {
     $group = $form->addGroup();
     $form->addText('name', 'Name');
     $form->addOne('route')->setCurrentGroup($group)->addTextArea('notation', 'Description', NULL, 4);
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:7,代码来源:PhotoFormFactory.php

示例8: configure

 public function configure(Form $form)
 {
     $form->addGroup('Nastavení API');
     $form->addText('accountNumber', 'Číslo účtu');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:7,代码来源:FormFactory.php

示例9: handleCatchError

 public function handleCatchError(Form $form, $e)
 {
     if ($e instanceof PermissionDeniedException) {
         $form->addError('You have not writable permissions.');
         return TRUE;
     }
 }
开发者ID:svobodni,项目名称:web,代码行数:7,代码来源:FileFormFactory.php

示例10: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addManyToMany('accounts', 'Accounts');
     $form->addText('itemsPerPage', 'Items per page')->addRule($form::FILLED)->addRule($form::NUMERIC);
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:PageFormFactory.php

示例11: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addGroup('Settings');
     $form->addText('itemsPerPage', 'Items per page');
     $form->setCurrentGroup();
     $form->addSaveButton('Save');
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:MenuFormFactory.php

示例12: handleSave

 public function handleSave(Form $form)
 {
     if ($form->isSubmitted() !== $form->getSaveButton()) {
         return;
     }
     $data = array('toolbar' => array());
     $i = TRUE;
     foreach ($form['toolbar']->values as $items) {
         if ($i) {
             $i = FALSE;
         } else {
             $data['toolbar'][] = '/';
         }
         $r = array();
         $i = TRUE;
         foreach ($items['line'] as $value) {
             if ($i) {
                 $i = FALSE;
             } else {
                 $data['toolbar'][] = array('items' => $r);
                 $r = array();
             }
             foreach ($value['items'] as $item) {
                 $r[] = $item;
             }
         }
         $data['toolbar'][] = array('items' => $r);
     }
     file_put_contents($this->ckeditorDir . '/backend.json', json_encode($data, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES));
 }
开发者ID:svobodni,项目名称:web,代码行数:30,代码来源:ToolbarFormFactory.php

示例13: handleSave

 public function handleSave(Form $form)
 {
     $values = $form->values;
     if ($values['file']->isOk()) {
         if ($values['cleanout']) {
             foreach ($this->userRepository->findAll() as $user) {
                 $this->userRepository->delete($user);
             }
         }
         /** @var FileUpload $file */
         $file = $values['file'];
         $data = file_get_contents($file->getTemporaryFile());
         foreach (explode("\n", $data) as $row) {
             if (!$row) {
                 continue;
             }
             $items = explode(',', $row);
             if (!count($items)) {
                 continue;
             }
             try {
                 $user = new UserEntity(trim($items[0]));
             } catch (InvalidArgumentException $e) {
                 $form->addError($e->getMessage());
             }
             $this->userRepository->save($user);
         }
     }
 }
开发者ID:venne,项目名称:newsletter-module,代码行数:29,代码来源:ImportFormFactory.php

示例14: configure

 /**
  * @param Form $form
  */
 public function configure(Form $form)
 {
     $form->addHidden('provider')->setValue($this->provider);
     $form['parameters'] = $this->securityManager->getLoginProviderByName($this->provider)->getFormContainer();
     $form->addSaveButton('Sign in')->getControlPrototype()->class[] = 'btn-primary';
     $form->addSubmit('cancel', 'Cancel')->setValidationScope(FALSE);
 }
开发者ID:svobodni,项目名称:web,代码行数:10,代码来源:ProviderFormFactory.php

示例15: configure

 /**
  * @param Form $form
  */
 public function configure(Venne\Forms\Form $form)
 {
     $form->addGroup('Template');
     $form->addTextArea('template', 'Product template')->getControlPrototype()->attrs['class'] = 'input-block-level';
     $form->addMailform('mailform');
     $form->addSaveButton('Save');
 }
开发者ID:venne,项目名称:catalog-module,代码行数:10,代码来源:MailformFormFactory.php


注:本文中的Venne\Forms\Form类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。