本文整理汇总了PHP中Nette\Application\UI\Form::addCheckBox方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::addCheckBox方法的具体用法?PHP Form::addCheckBox怎么用?PHP Form::addCheckBox使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\Form
的用法示例。
在下文中一共展示了Form::addCheckBox方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createComponentLoginForm
public function createComponentLoginForm()
{
$form = new Nette\Application\UI\Form();
$form->addText("username", "Jméno")->addRule(Nette\Application\UI\Form::FILLED, "Jméno musí být vyplněno");
$form->addPassword("password", "Heslo")->addRule(Nette\Application\UI\Form::FILLED, "Heslo musí být vyplněno");
$form->addCheckBox("remember", "Zůstat přihlášen");
$form->addSubmit("submit", "Přihlásit se");
$form->onSuccess[] = $this->loginFormSucceeded;
return $form;
}
示例2: createComponentSignInForm
protected function createComponentSignInForm()
{
$form = new Form();
$form->getElementPrototype()->class('ajax');
$form->addText('email')->setAttribute('class', 'input')->setAttribute('placeholder', 'E-mail');
$form->addPassword('passwd')->setAttribute('class', 'input')->setAttribute('placeholder', 'Heslo');
$form->addSubmit('signInBut', 'Přihlásit')->setAttribute('class', 'submit_button');
$form->addCheckBox('stay_logged', 'Neodhlašovat');
$form->onSuccess[] = array($this, 'signInFormSucceeded');
return $form;
}
示例3: createComponentEditGuestApplicationForm
public function createComponentEditGuestApplicationForm()
{
$token = $this->getParameter('token');
$guest = $this->guestModel->getGuestByToken($token);
$application = $this->applicationModel->getApplicationByGuest($guest->id);
$races_appl = $this->applicationModel->getApplicationRaces($application->id);
$services_appl = $this->applicationModel->getApplicationServices($application->id);
$event = $this->eventModel->getEvent($application->event);
$races = $this->eventModel->getEventRaces($event->id);
$services = $this->eventModel->getEventServices($event->id);
$form = new Nette\Application\UI\Form();
$form->addText('name', 'Jméno závodníka')->addRule(Nette\Application\UI\Form::FILLED, 'Jméno závodníka musí být vyplněno')->setDefaultValue($guest->name);
$form->addText('competitor_index', 'Index závodníka')->addRule(Nette\Application\UI\Form::FILLED, 'Index závodníka musí být vyplněn')->setDefaultValue($guest->competitor_index);
$form->addText('sportident', 'Číslo čipu')->setDefaultValue($application->si);
foreach ($races_appl as $key => $val) {
$categories = $this->categoryModel->getRaceCategoriesArray($val->race);
$raceInputName = 'race_' . $val->race;
$categoryInputName = 'category_' . $val->race;
$form->addCheckBox($raceInputName)->setDefaultValue($val->checked);
$form->addSelect($categoryInputName, '', $categories)->setDefaultValue($val->category);
}
foreach ($services_appl as $key => $val) {
$serviceInputName = 'service_' . $val->service;
$form->addCheckBox($serviceInputName)->setDefaultValue($val->checked);
}
$form->addSubmit('submit', 'Upravit přihlášku');
$form->addProtection();
$form->onSuccess[] = $this->editGuestApplicationFormSucceeded;
return $form;
}