回调在Codeigniter 3.0中不起作用

沙申克·巴特(Shashank Bhat)
<?php

class Form extends CI_Controller {

    public function index()
    {
        $this->load->helper(array('form', 'url'));

        $this->load->library('form_validation');

        $this->form_validation->set_rules('email', 'Email', 'required|valid_email');
        $this->form_validation->set_rules('password', 'Password', 'required');
        $this->form_validation->set_rules('confpassword', 'Password', 'required|matches[password]', 'callback__matcherror');



        //$this->form_validation->set_rules('passconf', 'Password Confirmation', 'required');
        //$this->form_validation->set_rules('email', 'Email', 'required');

        if ($this->form_validation->run() == FALSE)
        {
            $this->load->view('login');

        }
        else
        {

            $this->load->view('insert_dream');

        }

    }

public function _matcherror() {
    $this->form_validation->set_message('_matcherror', 'Passwords should match');
    return FALSE;
}

}
?>

我是Codeigniter的新手。上面的代码不显示密码应与错误消息匹配。回调有问题还是我遗漏了一些东西。

乔治

在这里看看您无需进行回调。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章