Quantcast
Channel: Blog - Flourish Pixel » codeIgniter
Viewing all articles
Browse latest Browse all 3

How to configure CodeIgniter?

$
0
0

The structure of CodeIgniter is solid, now i’m going to describe at how you can configure the CodeIgniter framework so that it works the way you expect.

Config Folder of CodeIgniter

All of CI’s configuration files are stored in application/config.

- config
— autoload.php
— config.php
— constants.php
— database.php
— doctypes.php
— hooks.php
— mimes.php
— routes.php
— smileys.php
— user_agents.php

The purpose of each file coincides with it’s name. To get us up and running we are only going to worry about autoload.php, config.php, database.php and routes.php
codeigniter configuration

config.php

The main configuration file for the CodeIgniter framework id config.php. In this file you can control things like logging, character sets, extension prefixs, etc. The only thing we need to change here are lines 14 and 26.

Line 14 holds the full web path to your CI installation and Line 26 of the config file holds the name of the index file.

autoload.php

Libraries – database, session

Helper – form, url

The libraries above, database and session, are the default CI libraries to handle database abstraction and user sessions (note, if your app doesn’t use a database consistently throughout the whole app you might not want to autoload this library). The form and url helpers are both default CI helpers.

database.php

If your CodeIgniter application is interacting with a database then you need to update the database.php config file. This file stores the access information for the database or databases that your app will be interacting with.

routes.php

The routes.php file allows you to define custom URLs and map them to specfic controllers and methods. This is a very powerful tool that comes built into the CodeIgniter framework. The only thing we want to update in this file to get started is line 43. Right now it’s set for the default welcome message we saw before. I usually set this variable to home/landing page.

Main Reference: Chris Monnat Blog

The post How to configure CodeIgniter? appeared first on Blog - Flourish Pixel.


Viewing all articles
Browse latest Browse all 3

Latest Images

Trending Articles





Latest Images