本文整理汇总了PHP中EmailField::name方法的典型用法代码示例。如果您正苦于以下问题:PHP EmailField::name方法的具体用法?PHP EmailField::name怎么用?PHP EmailField::name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EmailField
的用法示例。
在下文中一共展示了EmailField::name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _createForgotPassForm
public function _createForgotPassForm()
{
$form = new Form();
$form->action = "/forgotpass";
$form->add(EmailField::name('email')->label('Email')->help('What is your email address?')->required(true));
return $form;
}
示例2: _createProfileEditForm
/**
* @param User $user
* @return Form
*/
private function _createProfileEditForm($user)
{
$form = new Form();
$form->add(DisplayField::name('username')->label("Username")->value($user->get('username')));
$form->add(EmailField::name('email')->label("Email")->value($user->get('email'))->required(true));
if (User::$me->isAdmin()) {
$form->add(CheckboxField::name('admin')->label("Is admin?")->help("Is this user an admin?")->checked($user->isAdmin()));
}
// todo add DateField
/**
$form->add(
DateField::name('birthday')
->label("Birthday")
->value($user->get('birthday'))
);
*/
$password_page = $user->getUrl() . "/changepass";
$form->add(DisplayField::name('changepass')->label("Change Password")->value("Please visit the <a href=\"{$password_page}\">change password</a> page."));
return $form;
}
示例3: _createRegisterForm
public function _createRegisterForm()
{
$form = new Form('register');
if (!$this->args('username')) {
$username = '';
} else {
$username = $this->args('username');
}
if (!$this->args('email')) {
$email = '';
} else {
$email = $this->args('email');
}
$form->add(TextField::name('username')->label("Username")->value($username)->required(true));
$form->add(EmailField::name('email')->label("Email address")->value($email)->required(true));
$form->add(PasswordField::name('pass1')->label("Password")->required(true));
$form->add(PasswordField::name('pass2')->label("Password Confirmation")->required(true));
$tos = "By clicking on the \"Create your account\" button below, you certify that you have read and agree to our ";
$tos .= "<a href=\"/tos\">Terms of use</a>";
$tos .= " and ";
$tos .= "<a href=\"/privacy\">Privacy Policy</a>.";
$form->add(DisplayField::name('tos')->value($tos));
$form->setSubmitText("Create your account");
$form->setSubmitClass("btn btn-success btn-large");
return $form;
}