Welcome Guest, Not a member yet? Register   Sign In
Check method/function exist with Controller
#4

You can use the _remap method from CI as described here:

http://www.codeigniter.com/userguide3/ge...thod-calls

The following short example shows you a quick usage

PHP Code:
class User extends CI_Controller {
    public function 
__construct() {
      
parent::__construct();
    }

    function 
_remap($method)
    {
        if(
method_exists($this,$method))
        {
            
call_user_func(array($this$method));
            return 
false;
        }
        else
        {
            echo 
'Method not found!';
        }
    }

    
// .... your methods ....



Reply


Messages In This Thread
RE: Check method/function exist with Controller - by Rufnex - 12-12-2014, 04:04 AM



Theme © iAndrew 2016 - Forum software by © MyBB