Helper in codeigniter

Helper Functions

Helpers, as the name suggests, help you with tasks. Each helper file is simply a collection of functions in a particular category. There are URL Helpers, that assist in creating links, there are Form Helpers that help you create form elements, Text Helpers perform various text formatting routines, Cookie Helpers set and read cookies, File Helpers help you deal with files, etc.

Unlike most other systems in CodeIgniter, Helpers are not written in an Object Oriented format. They are simple, procedural functions. Each helper function performs one specific task, with no dependence on other functions.
Read More

Auto-loading Resources

CodeIgniter comes with an “Auto-load” feature that permits libraries, helpers, and models to be initialized automatically every time the system runs. If you need certain resources globally throughout your application you should consider auto-loading them for convenience.

The following items can be loaded automatically:

1) Classes found in the libraries/ directory
2) Helper files found in the helpers/ directory
3) Custom config files found in the config/ directory
4) Language files found in the system/language/ directory
5) Models found in the models/ folder

To autoload resources, open the application/config/autoload.php file and add the item you want loaded to the autoload array. You’ll find instructions in that file corresponding to each type of item.

Do not include the file extension (.php) when adding items to the autoload array.

Additionally, if you want CodeIgniter to use a Composer auto-loader, just set $config[‘composer_autoload’] to TRUE or a custom path in application/config/config.php.

How to manage controllers in Codeigniter

Controllers are the heart of your application, as they determine how HTTP requests should be handled.

This post contains information as follows –

    1) What is a Controller?
    2) Hello World
    3) Functions
    4) Passing URI Segments to Your Functions
    5) Defining a Default Controller
    6) Remapping Function Calls
    7) Controlling Output Data
    8) Private Functions
    9) Organizing Controllers into Sub-folders
    10) Class Constructors
    11) Reserved Function Names

Read More