本文整理汇总了PHP中Nette\Application\UI\Form::enableLocalized方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::enableLocalized方法的具体用法?PHP Form::enableLocalized怎么用?PHP Form::enableLocalized使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Nette\Application\UI\Form
的用法示例。
在下文中一共展示了Form::enableLocalized方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: create
/**
* @return Form
*/
public function create()
{
$form = new Form();
$form->enableLocalized();
$form->addText('email')->setRequired('errors.fill_email')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'email')->addRule(Form::EMAIL, 'errors.fill_email_success');
$form->addPassword('password')->setRequired('errors.fill_password')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'password');
$form->addCheckbox('remember', 'remember');
$form->addSubmit('submit', 'login')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
$form->onSuccess[] = array($this, 'formSucceeded');
return $form;
}
示例2: editPass
public function editPass($id)
{
$this->user_id = $id;
$form = new Form();
$form->enableLocalized();
$form->addPassword('password')->setRequired('errors.fill_password')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'password');
$form->addPassword('password2')->setRequired('errors.password_authentication')->setAttribute('class', 'form-control')->addRule(Form::EQUAL, 'errors.passwords_match', $form['password'])->setAttribute('placeholder', 'password_retry');
$form->addSubmit('submit', 'edit')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
$form->onSuccess[] = $this->success_form_pass;
return $form;
}
示例3: create
/**
* @return Form
*/
public function create($name)
{
$form = new Form();
$form->enableLocalized();
$text = $this->textManager->getText($name);
$this->text = $text;
$form->addTextArea('text')->setValue($text->text)->setAttribute('id', 'ckeditor');
$form->addSubmit('submit', 'save')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
$form->onSuccess[] = array($this, 'formSucceeded');
return $form;
}
示例4: create
public function create()
{
$form = new Form();
$form->enableLocalized();
$form->addText('name')->setRequired('errors.fill_role_name')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'role_name');
$form->addTextArea('access', 'role_access')->setAttribute('class', 'form-control');
$form->addTextArea('description', 'description')->setAttribute('class', 'form-control');
$form->addTextArea('access_ban', 'access_ban')->setAttribute('class', 'form-control');
$form->addSubmit('submit', 'add')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
$form->onSuccess[] = $this->success_form_add;
return $form;
}
示例5: create
public function create()
{
$form = new Form();
$form->enableLocalized();
$form->addText('username')->setRequired('errors.fill_user_name')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'user_name');
$form->addUpload('img')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'img')->addCondition(Form::FILLED)->addRule(Form::IMAGE, 'errors.img');
$form->addText('email')->setRequired('errors.fill_email')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'email')->addRule(Form::EMAIL, 'errors.fill_email_success')->addRule($this->checkEmail, 'errors.email_used');
$form->addSelect('role', $form->translate('role'), $this->getRoleList())->setRequired('errors.role')->setTranslator(null)->setAttribute('class', 'form-control');
$form->addPassword('password')->setRequired('errors.enter_password')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'password');
$form->addPassword('password2')->setRequired('errors.enter_password_retry')->setAttribute('class', 'form-control')->addRule(Form::EQUAL, 'errors.password_must_match', $form['password'])->setAttribute('placeholder', 'password_retry');
$form->addSubmit('submit', 'register')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
$form->onSuccess[] = $this->success_form_add;
return $form;
}
示例6: create
/**
*
* @param integer $id
* @return Form
*/
public function create($id)
{
$this->user_id = $id;
$user = $this->user_manager->getUser($id);
$form = new Form();
$form->enableLocalized();
$form->addText('name')->setValue($user->name)->setRequired('errors.fill_user_name')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'name_surname');
$form->addText('email')->setValue($user->email)->setRequired('errors.fill_email')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'email')->addRule(Form::EMAIL, 'errors.fill_email_success')->addRule($this->checkEmailUpdate, 'errors.email_used');
$form->addPassword('password')->setRequired('errors.fill_password')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'password');
$form->addUpload('img')->setAttribute('class', 'form-control')->setAttribute('placeholder', 'img')->addCondition(Form::FILLED)->addRule(Form::IMAGE, 'errors.img');
$form->addPassword('password2')->setRequired('errors.enter_password_retry')->setAttribute('class', 'form-control')->addRule(Form::EQUAL, 'errors.password_must_match', $form['password'])->setAttribute('placeholder', 'password_retry');
$form->addSubmit('submit', 'edit')->setAttribute('class', 'btn btn-primary btn-purple btn-flat');
$form->onSuccess[] = $this->success_form;
return $form;
}