handling get urls in codeigniter

后端 未结 1 1652
一生所求
一生所求 2020-12-22 12:08

I am trying to create a message that shows up when login.php?e=1 on the login page: /login/. The issue I am coming to have is that in codeigniter w

相关标签:
1条回答
  • 2020-12-22 12:52

    there is nothing to show just hit this link.

    If you are lazy then watch it here.

    _remap function overrides index() (or any other declared function in a controller), in a way

    function _remap($method, $params) {
    
        if (method_exists($this, $method)) {
    
            return call_user_func_array(array($this, $method), $params);
    
        } else {
    
            array_unshift($params, $method);
            return call_user_func_array(array($this, "index"), $params);
    
        }
    
    }
    

    //after 1st comment take a look here

    function _remap($method, $params) { //this is "kind" of your new index(); but it takes parameters
    
        if ($method == 'e') {
    
            echo $params[0];
    
        } else {
    
            show_404();
    
        }
    
    }
    
    0 讨论(0)
提交回复
热议问题