Welcome Guest, Not a member yet? Register   Sign In
Best place to put variables you need throughout the application

Let's say you have information like $sitename = "Name of your site" and other information you might need on every page, where is the best place to put this information? I tried adding it to the config file which would make sense but could not access it in the controller.

Thanks in advance.

How did you add it, and how were you trying to access it?

I added it as:

$config['s_sitename'] = "Site Name Here";

Then tried to call it as:


You can access it with :

Although personally I would load theses kinds of variables in MY_Controller and extend all my controllers from there.

Theme © iAndrew 2016 - Forum software by © MyBB