Welcome Guest, Not a member yet? Register   Sign In
Some functions in Controller
#2

1. you can create application/core/MY_Controller.php 

and all you controllers will extend MY_Controller instead of CI_Controller

MY_Controller.php:
PHP Code:
class MY_Controller extends CI_Controller {

 
   public function __construct() {

 
       parent::__construct();
}

protected function 
yourfunction(){
 
//...
}



2. or you can use models
 put your function in a model
Reply


Messages In This Thread
Some functions in Controller - by rolly - 11-17-2017, 07:25 AM
RE: Some functions in Controller - by neuron - 11-17-2017, 08:31 AM
RE: Some functions in Controller - by Narf - 11-17-2017, 11:16 AM
RE: Some functions in Controller - by neuron - 11-18-2017, 05:54 AM
RE: Some functions in Controller - by kilishan - 11-17-2017, 09:32 AM
RE: Some functions in Controller - by rolly - 11-17-2017, 11:12 AM
RE: Some functions in Controller - by dave friend - 11-18-2017, 07:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB