How to load CodeIgniter helpers on each page?

I have a view, header.php that loads into various controller methods. It contains my html opening tag, a base tag for my relative links, and some meta tags that I call on every page of my application. Is there a way to load helpers that display meta tags and a base url so that they are available for header.php every time I load without having to turn it on $this->load->helper('html');and $this->load->helper('url');every time I'm $this->load->view('templates/header', $data);in the controller to load header.php?

+5
source share
2 answers

If you need this often, you just need to add them to your startup assistants:

/application/config/autoload.php 93,

$autoload['helper'] = array();

to

$autoload['helper'] = array('html', 'url');

.

+18

, . , , .

0

All Articles