Welcome Guest, Not a member yet? Register   Sign In
Help with helpers
#11

[eluser]InsiteFX[/eluser]
You create a MY_Controller and place it in your libraries folder.

Then extend all your new controllers from the MY_Controller.

You can place all your duplicated code that you want to run
in the MY_Controller.

This will show you how to do it!

Phil's base classes

InsiteFX
#12

[eluser]gyo[/eluser]
@gmask: yeah that is ok, or you can also place the settings in the controller, like:

Code:
$this->load->helper('my_helper');

$settings = settings();
$this->load->view('index', $settings);

This way the variables are 'prettier' inside the view, where you can just use $title, $location, $tagline.

But, if you need that piece of code EVERYWHERE, the suggestion of InsiteFX to use MY_Controller is very recomendable.




Theme © iAndrew 2016 - Forum software by © MyBB