本文整理汇总了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;
}
示例2: create
/**
* @return Form
*/
public function create()
{
$form = new Form();
$form->setTranslator($this->translator);
$form->setRenderer(new \Nextras\Forms\Rendering\Bs3FormRenderer());
return $form;
}
示例3: getBootstrapForm
protected function getBootstrapForm()
{
$form = new Form();
$renderer = new BT3Renderer();
$form->setRenderer($renderer);
return $form;
}
示例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;
}
示例5: create
/**
* @return Form
*/
public function create()
{
$form = new Form();
$form->setTranslator($this->translator);
$form->setRenderer(new BaseFormRenderer());
return $form;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}