public function createComponentCreatePassword() { $form = new MyForm(); $form->renderStyle = $form::SEMANTIC; $form->setTranslator($this->translator); $renderer = $form->getRenderer(); $renderer->wrappers['controls']['container'] = 'div class="control-group"'; $renderer->wrappers['pair']['container'] = NULL; $renderer->wrappers['label']['container'] = NULL; $renderer->wrappers['control']['container'] = 'div class="controls"'; $form->addPassword('prvniheslo', 'Your new password:'******'Please, insert your password.')->addRule(Form::MIN_LENGTH, 'Password must be least %d characters long.', 6); $form->addPassword('druheheslo', 'Password again:')->setRequired()->addRule(Form::FILLED, 'Please, insert second password for confirmation.'); $form->addSubmit('save', 'Save password')->setAttribute("class", "primary"); $form->addSubmit('cancel', 'Cancel')->setAttribute("class", "secondary")->setValidationScope(FALSE)->onClick[] = callback($this, 'toUser'); $form->onSuccess[] = array($this, 'savePassword'); return $form; }