Welcome Guest, Not a member yet? Register   Sign In
implementing the third parameter in model class
#1

[eluser]diez[/eluser]
in the documentation for the model class it says that you can use a third parameter to configure your database settings.

i was curious if you can use the 3rd parameter to be passed into the current model being instantiated?

for instance:

$this->load->model('Model_name', '', $parameters_for_this_model);
#2

[eluser]LuckyFella73[/eluser]
Just catch the 3rd parameter, for example:

Code:
$param = $this->uri->segment(3);

and do with $param whatever you want.

In your case:
Code:
$param = $this->uri->segment(3);
$this->load->model(’Model_name’, ‘’, $param);

or shorter:
Code:
$this->load->model(’Model_name’, ‘’, $this->uri->segment(3));




Theme © iAndrew 2016 - Forum software by © MyBB