Welcome Guest, Not a member yet? Register   Sign In
Check a function before doing anything?
#2

i think you can do this :
- create a controller in /core/ that extends CI_Controller and call your function in constructor function of that class,
- your other controllers must extend your controller class,

example , i use this base class for my project, notice you must use MY_ (or any that you set in config) instead of N2_

Code:
class N2_Controller extends CI_Controller {

    function __construct()
    {
        $this->auth->is_login();
        parent::__construct();
    }
}

and your other controllers :

Code:
defined('BASEPATH') OR exit('No direct script access allowed');

class Child_controller extends N2_Controller {

    public function index(){

    }
...
ressan.ir
CI is nice Heart
Reply


Messages In This Thread
RE: Check a function before doing anything? - by nasser.man - 04-12-2015, 08:51 AM



Theme © iAndrew 2016 - Forum software by © MyBB