Welcome Guest, Not a member yet? Register   Sign In
Difficulty understanding how to code up a webpage
#6

[eluser]FX[/eluser]
[quote author="sophistry" date="1186689884"]do it the pure OOP way - extend the CI controller with a master controller that is then extended by all of your controllers, use $this->load->vars() in the master.[/quote]

I try to build my first site with CI, and i have just been trying to do that. I had my includes variables in the specific config file, that i autoload, but i would like the config items linked to my included views would be loaded once for all.

You gave me the key i miss, the $this->load->vars() method, anyway i still have a issue : extending the Controller class.

in a application/libraries/MY_Controller.php file, i have this php code :

Quote:class MY_Controller extends CI_Controller {

function MY_Controller()
{
parent::CI_Controller();
var_dump($this);
}

}

and i get a fatal error,
Quote:Fatal error: Class my_controller: Cannot inherit from undefined class ci_controller in /mnt/149/sda/5/3/radio.secteur51/system/application/libraries/MY_Controller.php on line 2

i don't understand why, i haven't changed config prefixes...


Messages In This Thread
Difficulty understanding how to code up a webpage - by El Forum - 08-08-2007, 10:23 AM
Difficulty understanding how to code up a webpage - by El Forum - 08-08-2007, 10:50 AM
Difficulty understanding how to code up a webpage - by El Forum - 08-08-2007, 12:52 PM
Difficulty understanding how to code up a webpage - by El Forum - 08-09-2007, 04:36 AM
Difficulty understanding how to code up a webpage - by El Forum - 08-09-2007, 09:04 AM
Difficulty understanding how to code up a webpage - by El Forum - 08-11-2007, 12:59 PM
Difficulty understanding how to code up a webpage - by El Forum - 08-11-2007, 07:07 PM
Difficulty understanding how to code up a webpage - by El Forum - 08-12-2007, 02:23 AM
Difficulty understanding how to code up a webpage - by El Forum - 08-12-2007, 02:45 AM



Theme © iAndrew 2016 - Forum software by © MyBB