protected function createComponentContactForm() { $form = new Form(); $rendered = new Bs3FormRenderer(); $rendered->wrappers['control']['container'] = 'div class=col-sm-10'; $rendered->wrappers['label']['container'] = 'div class="col-sm-2 control-label"'; $form->addProtection('Vypršel časový limit, odešlete formulář znovu'); $form->setRenderer($rendered); $form->addText('name', 'Vaše jméno')->addRule(Form::FILLED, 'Vyplňte vaše jméno'); $form->addText('email', 'Váš e-mail')->setEmptyValue('@')->addRule(Form::FILLED, 'Vyplňte váš e-mail')->addRule(Form::EMAIL, 'E-mail má nesprávný tvar'); $form->addTextarea('text', 'Zpráva')->addRule(Form::FILLED, 'Vyplňte zprávu')->setAttribute('rows', 12); $form->addReCaptcha('captcha')->addRule(ReCaptchaControl::VALID, 'Zatrhněte, že nejste robot :)'); $form->addSubmit('okSubmit', 'Odeslat'); $form->onSuccess[] = [$this, 'contactFormSubmitted']; return $form; }