本文整理匯總了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;
}