本文整理汇总了PHP中Forge::set_attr方法的典型用法代码示例。如果您正苦于以下问题:PHP Forge::set_attr方法的具体用法?PHP Forge::set_attr怎么用?PHP Forge::set_attr使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Forge
的用法示例。
在下文中一共展示了Forge::set_attr方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _form
private static function _form()
{
$form = new Forge("reauthenticate/auth", "", "post", array("id" => "g-reauthenticate-form"));
$form->set_attr('class', "g-narrow");
$group = $form->group("reauthenticate")->label(t("Re-authenticate"));
$group->password("password")->label(t("Password"))->id("g-password")->class(null)->callback("auth::validate_too_many_failed_auth_attempts")->callback("user::valid_password")->error_messages("invalid", t("Incorrect password"))->error_messages("too_many_failed_auth_attempts", t("Too many incorrect passwords. Try again later"));
$group->submit("")->value(t("Submit"));
return $form;
}
示例2: Forge
static function get_login_form($url)
{
$form = new Forge($url, "", "post", array("id" => "g-login-form"));
$form->set_attr('class', "g-narrow");
$group = $form->group("login")->label(t("Login"));
$group->input("name")->label(t("Username"))->id("g-username")->class(null);
$group->password("password")->label(t("Password"))->id("g-password")->class(null);
$group->inputs["name"]->error_messages("invalid_login", t("Invalid name or password"));
$group->submit("")->value(t("Login"));
return $form;
}
示例3: Forge
static function get_login_form($url)
{
$form = new Forge($url, "", "post", array("id" => "g-login-form"));
$form->set_attr("class", "g-narrow");
$group = $form->group("login")->label(t("Login"));
$group->input("name")->label(t("Username"))->id("g-username")->class(null)->callback("auth::validate_too_many_failed_logins")->error_messages("too_many_failed_logins", t("Too many failed login attempts. Try again later"));
$group->password("password")->label(t("Password"))->id("g-password")->class(null);
$group->inputs["name"]->error_messages("invalid_login", t("Invalid name or password"));
$group->submit("")->value(t("Login"));
return $form;
}
示例4: _get_edit_form
private function _get_edit_form($user)
{
$form = new Forge("users/update/{$user->id}", "", "post", array("id" => "g-edit-user-form"));
$form->set_attr("class", "g-narrow");
$group = $form->group("edit_user")->label(t("Edit User: %name", array("name" => $user->name)));
$group->input("full_name")->label(t("Full Name"))->id("g-fullname")->value($user->full_name);
self::_add_locale_dropdown($group, $user);
$group->password("password")->label(t("Password"))->id("g-password");
$group->password("password2")->label(t("Confirm Password"))->id("g-password2")->matches($group->password);
$group->input("email")->label(t("Email"))->id("g-email")->value($user->email);
$group->input("url")->label(t("URL"))->id("g-url")->value($user->url);
$form->add_rules_from($user);
module::event("user_edit_form", $user, $form);
$group->submit("")->value(t("Save"));
return $form;
}
示例5: Forge
static function get_add_form_admin()
{
$form = new Forge("admin/users/add_group", "", "post", array("id" => "g-add-group-form"));
$form->set_attr('class', "g-narrow");
$form_group = $form->group("add_group")->label(t("Add Group"));
$form_group->input("name")->label(t("Name"))->id("g-name");
$form_group->inputs["name"]->error_messages("in_use", t("There is already a group with that name"));
$form_group->submit("")->value(t("Add Group"));
$group = ORM::factory("group");
$form->add_rules_from($group);
return $form;
}