Welcome Guest, Not a member yet? Register   Sign In
DRY approach with different request type
#2

You're better off extending the controllers from a "base" one which has this check in it.

http://www.codeigniter.com/userguide3/ge...core-class

PHP Code:
class Welcome extends MY_Controller {

 
       public function __construct()
 
       {
 
               parent::__construct();
 
       }

 
       public function index()
 
       {
 
               $this->load->view('welcome_message');
 
       }


Then in MY_Controller you can put your check code in the constructor and redirect if it fails, as you said.
Reply


Messages In This Thread
RE: DRY approach with different request type - by JayAdra - 10-17-2016, 04:43 PM



Theme © iAndrew 2016 - Forum software by © MyBB