I have a database table with some information about the website such as the site title, phone numbers etc... This information is needed on every page. Is there a way i could get those database values into variables on every page without having to write the same code in every page controllers?
Thanks, Marais
getData()into the model that handles the database table; then call the method from any controller you need; If you're making the same call from different controllers during a single request just use caching to avoid querying the database again for the same data$data = $this->some_model->get_data(); $view['data'] = $data;