Welcome Guest, Not a member yet? Register   Sign In
Where to put standard functions that reference lib/mod methods
#2

(This post was last modified: 08-10-2015, 11:59 PM by Wouter60.)

You can make your own MY_Controller and MY_Model.

PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
MY_Controller extends CI_Controller {

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

//your basic functions here


PHP Code:
class MY_Model extends CI_Model {

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

//your basic functions here



Save both files in the application/core folder.

Now, when you create a controller that needs the basic functions in your MY_Controller, you start it like in the example below:
PHP Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class 
Home extends MY_Controller {



And the same goes for models that are based upon your own MY_Model.
Reply


Messages In This Thread
RE: Where to put standard functions that reference lib/mod methods - by Wouter60 - 08-10-2015, 11:57 PM



Theme © iAndrew 2016 - Forum software by © MyBB