Check method/function exist with Controller - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5) +--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24) +--- Thread: Check method/function exist with Controller (/showthread.php?tid=511) |
Check method/function exist with Controller - vrsotto - 12-11-2014 Hi guys, can anyone please help, how can i check if method/funcion exist within class/controller? say: PHP Code: class User extends CI_Controller { hope someone could help. Thanks in advanced RE: Check method/function exist with Controller - trentramseyer - 12-11-2014 Depending where in the application you want this to happen, you can use the _remap function from CI https://ellislab.com/codeigniter/user-guide/general/controllers.html PHP Code: public function _remap($method, $params = array()) RE: Check method/function exist with Controller - sv3tli0 - 12-12-2014 What is your idea ? Where you want to make this check? RE: Check method/function exist with Controller - Rufnex - 12-12-2014 You can use the _remap method from CI as described here: http://www.codeigniter.com/userguide3/general/controllers.html#remapping-method-calls The following short example shows you a quick usage PHP Code: class User extends CI_Controller { RE: Check method/function exist with Controller - vrsotto - 12-14-2014 Ahh, thank you guys. very much appreciated all your help. |