本文整理汇总了PHP中Venne\Forms\Form::addPassword方法的典型用法代码示例。如果您正苦于以下问题:PHP Form::addPassword方法的具体用法?PHP Form::addPassword怎么用?PHP Form::addPassword使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Venne\Forms\Form
的用法示例。
在下文中一共展示了Form::addPassword方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: configure
/**
* @param Form $form
*/
protected function configure(Form $form)
{
$form->addGroup('Admin account');
$form->addText('name', 'Name');
$form->addPassword('password', 'Password')->setOption('description', 'minimal length is 5 char');
$form->addPassword('_password', 'Confirm password');
$form['name']->addRule($form::FILLED, 'Enter name');
$form['password']->addRule($form::FILLED, 'Enter password')->addRule($form::MIN_LENGTH, 'Password is short', 5);
$form['_password']->addRule($form::EQUAL, 'Invalid re password', $form['password']);
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例2: configure
/**
* @param Form $form
*/
protected function configure(Form $form)
{
$form->addGroup('Basic settings');
$form->addSelect('driver', 'Driver')->setItems($this->drivers, false)->setDefaultValue('pdo_mysql');
$form['driver']->addCondition($form::IS_IN, array('pdo_mysql', 'oci8', 'pdo_oci'))->toggle('group-charset');
$form['driver']->addCondition($form::IS_IN, array('pdo_pgsql', 'pdo_mysql', 'oci8', 'pdo_oci', 'pdo_sqlsrv'))->toggle('group-connection');
$form['driver']->addCondition($form::EQUAL, 'pdo_sqlite')->toggle('group-sqlite');
$form->addGroup('Connection settings');
$form->addText('user', 'Username');
$form->addPassword('password', 'Password');
$form->addGroup()->setOption('id', 'group-connection');
$form->addText('host', 'Host');
$form->addText('port', 'Port')->getControlPrototype()->placeholder[] = 'default';
$form->addText('dbname', 'Database');
$form->addGroup()->setOption('id', 'group-sqlite');
$form->addTextWithSelect('path', 'Path')->setItems(array('%tempDir%/database.db'), false);
$form->addCheckbox('memory', 'Db in memory');
$form->addGroup()->setOption('id', 'group-charset');
$form->addTextWithSelect('charset', 'Charset')->setItems(array('utf8'), false);
$backups = $this->getBackups();
if (count($backups)) {
$form->addGroup('Restore from backup');
$form->addSelect('_backup', 'Backup name', $backups)->setPrompt('--------');
}
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例3: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addText('username', 'E-mail')->setRequired('Please provide a e-mail.');
$form->addPassword('password', 'Password')->setRequired('Please provide a password.');
$form->addCheckbox('remember', 'Remember me on this computer');
$form->addSaveButton('Sign in')->getControlPrototype()->class[] = 'btn-primary';
$socialButtons = $form->addContainer('socialButtons');
foreach ($this->securityManager->getLoginProviders() as $loginProvider) {
$socialButtons->addSubmit(str_replace(' ', '_', $loginProvider), $loginProvider)->setValidationScope(FALSE);
}
}
示例4: configure
/**
* @param Form $form
*/
protected function configure(Form $form)
{
$form->addGroup('Mailer');
$smtp = $form->addCheckbox('smtp', 'Use SMTP');
$smtp->addCondition($form::EQUAL, TRUE)->toggle('form-smtp');
$form->addGroup()->setOption('id', 'form-smtp');
$form->addText('host', 'Host')->addConditionOn($smtp, $form::EQUAL, TRUE)->addRule($form::FILLED, 'Enter host');
$form->addText('port', 'Port')->addConditionOn($smtp, $form::EQUAL, TRUE)->addCondition($form::FILLED)->addRule($form::INTEGER, 'Enter number format');
$form['port']->setOption('placeholder', '25');
$form->addSelect('secure', 'Secure', array('ssl' => 'ssl', 'tls' => 'tls'))->setPrompt('-----');
$form->addText('username', 'Username')->addConditionOn($smtp, $form::EQUAL, TRUE)->addCondition($form::FILLED)->addRule($form::EMAIL, 'Enter email address');
$form->addPassword('password', 'Password');
$form->addText('timeout', 'Timeout')->addConditionOn($smtp, $form::EQUAL, TRUE)->addCondition($form::FILLED)->addRule($form::INTEGER, 'Enter number format');
$form->setCurrentGroup();
$form->addSaveButton('Save');
}
示例5: configure
/**
* @param Form $form
*/
public function configure(Form $form)
{
$form->addPassword('password', 'Password')->setOption('description', 'minimal length is 5 char')->addRule(Form::FILLED, 'Enter password')->addRule(Form::MIN_LENGTH, 'Password is short', 5);
$form->addPassword('password_confirm', 'Confirm password')->addRule(Form::EQUAL, 'Invalid re password', $form['password']);
$form->addSaveButton('Reset password')->getControlPrototype()->class[] = 'btn-primary';
}