Welcome Guest, Not a member yet? Register   Sign In
Best place to put AKA reading database from the config file..
#8

[eluser]CtheB[/eluser]
Excactly. That is what my post is saying.

In the route you set this:

$route['default_controller'] = "page_loader_controller";
$route['(.*)'] = "page_loader_controller/index/$1";

So it will load the main controller.

Then start the main controller class with this constructor:

Quote:class Page_loader_controller extends Controller {

public function __construct()
{
parent::Controller();
$this->load->model('page_loader_model', 'loader', TRUE);

$this->set_configuration();
}

So with my additional methods in the controller and the method you are able to do this everywhere in your application:

$this->config->item('some_value_from_your_configuration_table');


Messages In This Thread
Best place to put AKA reading database from the config file.. - by El Forum - 05-06-2009, 04:38 PM



Theme © iAndrew 2016 - Forum software by © MyBB