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


PHP Form::setRenderer方法代码示例

本文整理汇总了PHP中Nette\Application\UI\Form::setRenderer方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::setRenderer方法的具体用法?PHP Form::setRenderer怎么用?PHP Form::setRenderer使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Nette\Application\UI\Form的用法示例。


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

示例1: create

 public function create()
 {
     $form = new Form();
     $form->getElementPrototype()->addClass('form-horizontal');
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
开发者ID:jirinapravnik,项目名称:common,代码行数:7,代码来源:FormFactory.php

示例2: create

 /**
  * @return Form
  */
 public function create()
 {
     $form = new Form();
     $form->setTranslator($this->translator);
     $form->setRenderer(new \Nextras\Forms\Rendering\Bs3FormRenderer());
     return $form;
 }
开发者ID:krupaj,项目名称:my-blog,代码行数:10,代码来源:BaseFormFactory.php

示例3: getBootstrapForm

 protected function getBootstrapForm()
 {
     $form = new Form();
     $renderer = new BT3Renderer();
     $form->setRenderer($renderer);
     return $form;
 }
开发者ID:re1la2pse,项目名称:detinsky_projekt,代码行数:7,代码来源:BaseBT3Form.php

示例4: vytvorit

 public function vytvorit()
 {
     $form = new Form();
     $form->addText('meno', '*Meno:')->setRequired();
     $form->addText('datumNarodenia', 'Dátum narodenia(YYYY-MM-DD):')->addCondition(Form::FILLED)->addRule(Form::PATTERN, 'Nesprávny fomrát', '([0-9]){4}-([0-9]){1,2}-([0-9]){1,2}');
     $form->addText('datumUmrtia', 'Dátum úmrtia(YYYY-MM-DD):')->addCondition(Form::FILLED)->addRule(Form::PATTERN, 'Nesprávny fomrát', '([0-9]){4}-([0-9]){1,2}-([0-9]){1,2}');
     $form->addText('trieda', 'Trieda:');
     $form->addText('rad', 'Rad:');
     $form->addText('celad', 'Čelaď:');
     $form->addText('rod', 'Rod:');
     //Ziskam vsetky druhy zivocicha aby som to mohol dat do pola a pouzivat na vyber v select boxe
     $hodnotyDruhu = array();
     $druhyZivocichov = $this->database->table('druhZivocicha');
     foreach ($druhyZivocichov as $druhZivocicha) {
         $hodnotyDruhu[$druhZivocicha->IDDruhuZivocicha] = $druhZivocicha->nazov;
     }
     $form->addSelect('IDDruhuZivocicha', '*Druh:', $hodnotyDruhu)->setRequired();
     //Ziskam vsetky umiestnenia aby som to mohol dat do pola a pouzivat na vyber v select boxe
     $hodnotyUmiestnenia = array();
     $umiestnenia = $this->database->table('umiestnenie');
     foreach ($umiestnenia as $umiestnenie) {
         $hodnotyUmiestnenia[$umiestnenie->IDUmiestnenia] = $umiestnenie->nazov;
     }
     $form->addSelect('IDUmiestnenia', '*Umiestnenie:', $hodnotyUmiestnenia)->setRequired();
     $form->addSubmit('editovat', 'Editovať');
     $form->onSuccess[] = array($this, 'uspesne');
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
开发者ID:Raiper34,项目名称:IIS-ZOO,代码行数:29,代码来源:EditovatZivocichaForm.php

示例5: create

 /**
  * @return Form
  */
 public function create()
 {
     $form = new Form();
     $form->setTranslator($this->translator);
     $form->setRenderer(new BaseFormRenderer());
     return $form;
 }
开发者ID:kysela-petr,项目名称:generator-kysela,代码行数:10,代码来源:FormFactory.php

示例6: createComponentVytvoritForm

 protected function createComponentVytvoritForm()
 {
     $form = new Form();
     //Zivocich
     $hodnotyZivocich = array();
     $zivocichy = $this->database->table('zivocich');
     //ziskam si vsetkych zivocichov
     foreach ($zivocichy as $zivocich) {
         $hodnotyZivocich[$zivocich->IDZivocicha] = $zivocich->meno;
     }
     $form->addSelect('IDZivocicha', '*Živočích:', $hodnotyZivocich)->setRequired();
     //Zamestnanec
     $hodnotyZamestnancov = array();
     if ($this->getUser()->roles[0] == 'riaditeľ') {
         $zamestnanci = $this->database->table('zamestnanec');
         //ziskam si vsetkych zamestnancov
         foreach ($zamestnanci as $zamestnanec) {
             $hodnotyZamestnancov[$zamestnanec->RodneCislo] = $zamestnanec->meno . " " . $zamestnanec->priezvisko;
         }
     } else {
         $hodnotyZamestnancov[$this->getUser()->id] = $this->getUser()->getIdentity()->data['meno'];
     }
     $form->addSelect('RodneCislo', '*Zamestnanec:', $hodnotyZamestnancov)->setRequired();
     $form->addText('hmotnostZivocicha', 'Hmotnosť živočícha:')->addCondition(Form::FILLED)->addRule(Form::FLOAT, 'Pole musi obsahovať iba čísla!');
     $form->addText('rozmerZivocicha', 'Rozmer živočícha:')->addCondition(Form::FILLED)->addRule(Form::FLOAT, 'Pole musi obsahovať iba čísla!');
     $form->addText('datumTestu', '*Dátum testu(YYYY-MM-DD):')->setRequired()->addRule(Form::PATTERN, 'Nesprávny fomrát', '([0-9]){4}-([0-9]){2}-([0-9]){2}');
     $form->addSubmit('vytvorit', 'Vytvoriť');
     $form->onSuccess[] = array($this, 'uspesne');
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
开发者ID:Raiper34,项目名称:IIS-ZOO,代码行数:31,代码来源:TestPresenter.php

示例7: create

 /**
  * @return \Nette\Application\UI\Form
  */
 public function create()
 {
     $form = new Form();
     $form->addGroup($this->user ? 'Upravit uživatele' : 'Přidat uživatele');
     $form->addText("name", 'Jméno:')->setRequired('Vyplňte jméno');
     $form->addText("email", 'Email:')->setRequired('Vyplňte email')->addRule(function ($ctrl) {
         if ($this->user and $this->user->email == $ctrl->getValue()) {
             return TRUE;
         }
         return (bool) (!$this->userFacade->findUserByEmail($ctrl->getValue()));
     }, 'Email je obsazen, zvolte prosím jiný');
     $password = $form->addPassword("password", 'Heslo:');
     $password2 = $form->addPassword("password2", 'Heslo znovu:');
     if (!$this->user) {
         $password->setRequired('Vyplňte heslo');
         $password2->addRule(Form::FILLED, 'Vyplňte heslo znovu pro kontrolu')->addRule(Form::EQUAL, 'Hesla se neshodují', $password);
     } else {
         $password2->addConditionOn($password, Form::FILLED)->setRequired('Vyplňte heslo znovu pro kontrolu')->addRule(Form::EQUAL, 'Hesla se neshodují', $password);
     }
     $form->addSubmit("send", $this->user ? 'Upravit uživatele' : 'Přidat uživatele');
     $form->setRenderer(new Bs3FormRenderer());
     $form->onSuccess[] = $this->processForm;
     if ($this->user) {
         $form->setDefaults(["name" => $this->user->name, "email" => $this->user->email]);
     }
     return $form;
 }
开发者ID:Kotys,项目名称:eventor.io,代码行数:30,代码来源:SetUserForm.php

示例8: create

 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->addText("email", "Email")->setRequired("Zadej prosím platnou emailovou adresu.")->addRule(Form::EMAIL, "Zadej prosím platnou emailovou adresu.")->setType("email");
     $form->addSubmit("submit", "Zažádat o změnu hesla")->setAttribute("class", "btn btn-primary btn-lg btn-block");
     return $form;
 }
开发者ID:jaromir92,项目名称:Sportwin,代码行数:8,代码来源:ForgottenPasswordForm.php

示例9: create

 public static function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->addPassword("password", "Heslo")->setRequired("Zadejte prosím heslo, pomocí kterého se budete přihlašovat.")->addRule(Form::MIN_LENGTH, 'Heslo musí mít alespoň %d znaků', User::MIN_PASSWORD_LENGTH);
     $form->addPassword("passwordVerify", "Heslo znovu")->setRequired("Zadejte prosím stejné heslo ještě jednou.")->addRule(Form::EQUAL, "Zadaná hesla se musí shodovat", $form["password"]);
     $form->addSubmit("submit", "Vytvořit heslo")->setAttribute("class", "btn btn-primary btn-lg btn-block");
     return $form;
 }
开发者ID:jaromir92,项目名称:Sportwin,代码行数:9,代码来源:NewPasswordForm.php

示例10: vytvorit

 public function vytvorit()
 {
     $form = new Form();
     $form->addText('nazov', '*Názov:')->setRequired();
     $form->addSubmit('vytvorit', 'Vytvoriť');
     $form->onSuccess[] = array($this, 'uspesne');
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
开发者ID:Raiper34,项目名称:IIS-ZOO,代码行数:9,代码来源:VytvoritDruhForm.php

示例11: create

 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapInlineRenderer());
     $form->addText("email", "Odeslat tuto statistiku na email:")->setRequired("Zadej prosím platnou emailovou adresu, na kterou chceš statistiky v tabulce odeslat.")->addRule(Form::EMAIL, "Zadej prosím platnou emailovou adresu, na kterou chceš statistiky v tabulce odeslat.")->setValue($this->emailOwner)->setAttribute("size", 35)->setType("email");
     $form->addSubmit("send", "Odeslat")->setAttribute("class", "btn btn-success");
     $form->onSuccess[] = $this->sendStatsFormSucceeded;
     return $form;
 }
开发者ID:jaromir92,项目名称:Sportwin,代码行数:9,代码来源:SendStatsForm.php

示例12: createComponentRaceDeleteConfirm

 public function createComponentRaceDeleteConfirm()
 {
     $form = new Form();
     $form->addSubmit('cancel', 'Zpět')->onClick[] = [$this, 'formCancelled'];
     $form->addSubmit('send', 'OK');
     $form->onSuccess[] = [$this, 'raceDeleteSucceeded'];
     $form->setRenderer(new Bs3FormRenderer());
     return $form;
 }
开发者ID:horakmar,项目名称:gorgon,代码行数:9,代码来源:RacePresenter.php

示例13: create

 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapVerticalRenderer());
     $form->addText("email", "Email")->setRequired("Zadej prosím platnou emailovou adresu.")->addRule(Form::EMAIL, "Zadej prosím platnou emailovou adresu.")->setType("email");
     $form->addPassword("password", "Heslo")->setRequired("Zadej prosím své přihlašovací heslo.");
     $form->addSubmit("submit", "Přihlásit se")->setAttribute("class", "btn btn-primary btn-lg btn-block");
     $form->onSuccess[] = array($this, "signInFormSucceeded");
     return $form;
 }
开发者ID:jaromir92,项目名称:Sportwin,代码行数:10,代码来源:SignInForm.php

示例14: create

 public function create($userId)
 {
     $this->getUser($userId);
     $form = new Form();
     $form->setRenderer(new BootstrapInlineRenderer());
     $form->addSelect("role")->setItems($this->roleFacade->findPrivacy(true), false)->setDefaultValue($this->user->role)->setAttribute("onchange", "submit()");
     $form->addHidden("userId", $this->user->id);
     $form->onSuccess[] = $this->changeRoleFormSucceeded;
     return $form;
 }
开发者ID:jaromir92,项目名称:Sportwin,代码行数:10,代码来源:ChangeRoleForm.php

示例15: create

 public function create()
 {
     $form = new Form();
     $form->setRenderer(new BootstrapInlineRenderer());
     $form->addSelect("month")->setItems(DateTimeUtils::getMonths())->setDefaultValue(date("n"));
     $form->addSelect("year")->setItems(DateTimeUtils::getYears())->setDefaultValue(date("Y"));
     $form->addSubmit("send", "Vygenerovat")->setAttribute("class", "btn btn-default");
     $form->onSuccess[] = $this->generateStatsFormSucceeded;
     return $form;
 }
开发者ID:jaromir92,项目名称:Sportwin,代码行数:10,代码来源:GenerateStatsForm.php


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