本文整理汇总了PHP中validator::is_correct_login方法的典型用法代码示例。如果您正苦于以下问题:PHP validator::is_correct_login方法的具体用法?PHP validator::is_correct_login怎么用?PHP validator::is_correct_login使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类validator
的用法示例。
在下文中一共展示了validator::is_correct_login方法的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);
}