CodeIgniter Forums

Full Version: Automatically Load Helpers
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

El Forum

[eluser]Unknown[/eluser]
Hi everyone,

I've been working with Codeigniter, and I was just wondering how I can include helpers automatically instead of adding them to each controller. Is it okay to add it the the autoload.php in the config?

Best,
Dojo

El Forum

[eluser]sajid19991[/eluser]
[quote author="Dojo" date="1356985724"]Hi everyone,

I've been working with Codeigniter, and I was just wondering how I can include helpers automatically instead of adding them to each controller. Is it okay to add it the the autoload.php in the config?

Best,
Dojo[/quote]

Yes, thats very good and flexible thing to do....just make sure the helper file isnt too big or doesnt include many functions, im using a helper worth 6kb and doesnt gives problems at all, but when my helper was 14 kb the execution time was poor...so better to keep it under 10Kb and pure coding, good coding will always make sure of good performance....dont include heavy functions in helper....

Most of the time autoloding the helper wont give any problems....