本文整理匯總了PHP中validator::is_correct_pass方法的典型用法代碼示例。如果您正苦於以下問題:PHP validator::is_correct_pass方法的具體用法?PHP validator::is_correct_pass怎麽用?PHP validator::is_correct_pass使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類validator
的用法示例。
在下文中一共展示了validator::is_correct_pass方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: validator
function action_index()
{
if (isset($_POST['submit'])) {
$validator = new validator();
$data["errors"]["login"] = $validator->is_correct_login($_POST['login']) ? "" : "has-error";
$data["errors"]["pass"] = $validator->is_correct_pass($_POST['password']) ? "" : "has-error";
if ($this->model->approveUser($_POST['login'], $_POST['password']) && $validator->result) {
header("Location: /main");
} else {
$data["errors"]["login"] = "has-error";
$data["errors"]["pass"] = "has-error";
}
}
$data["login"] = $this->model->get_login();
$this->view->generate('login_view.php', 'template_view.php', $data);
}
示例2: validator
function action_index()
{
$validator = new validator();
$data["login"] = $this->model->get_login();
$data["options"] = $this->model->get_options();
if (isset($_POST['submit'])) {
$user = $this->create_user();
$data["errors"]["login"] = $validator->is_correct_login($user->login) ? "" : "has-error";
$data["errors"]["pass"] = $validator->is_correct_pass($user->password) ? "" : "has-error";
$data["errors"]["contacts"] = $validator->is_correct_contacts($user->contacts) ? "" : "has-error";
$data["errors"]["info"] = $validator->is_correct_info($user->user_info) ? "" : "has-error";
if ($validator->result) {
if ($this->model->add_user($user)) {
header("Location: /login");
}
}
}
$this->view->generate('registration_view.php', 'template_view.php', $data);
}