CodeIgniter is a PHP framework that enables developers to build and test web applications faster. It contains many code libraries, reusable classes, and functions that speed up the development process significantly. It works with the MVC pattern, which isolates the back-end from the front-end. This increases the flexibility of apps built using CodeIgniter.
In this blog, I'll show you the directory structure of CI folder and how to Install Codeigniter into your localhost.
Key concepts about CodeIgniter - :
Framework with a small footprint.
MVC approach to web development.
Open Source.
Simple to configure.
Gives exceptional performance.
Offers broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
Framework that requires nearly zero configuration.
Suited for complex solutions.
Clear and thorough documentation.
Makes coding in PHP simple and easy.
Step 1. Download CodeIgniter by going to this link: http://codeigniter.com/downloads/.
Step 2. Unzip the package to the htdocs directory of your Web Server or extract it to a directory in your local machine and copy and paste it under htdocs.
File Structure Overview - :
The Codeigniter Directory folder stores all the files which make CI work.
The application folder is almost identical to the contents of the system folder
this is so the user can have files that are particular to that application, for example if a
user only wanted to load a helper in one application he would place it in the system/application/helpers folder instead of the system/helpers folder.
The config folder stores all the config files relevant to the application. Which
includes information on what libraries the application should auto load and database details.
The controllers folder stores all the controllers for the application.
The errors folder stores all the template error pages for the application. When
an error occurs the error page is generated from one of these templates.
The helpers folder stores all the helpers which are specific to your application.
The hooks folder is for hooks which modify the functioning of CI's core files,
hooks should only be used by advanced users of CI
The language folder stores lines of text which can be loaded through the language
library to create multilingual sites.
The libraries folder stores all the libraries which are specific to your application.
The models folder stores all the models for the application.
The views folder stores all the views for the application
The System folder contains these files.
The cache folder stores all the caches generated by the caching library.
The codeigniter folder stores all the internals which make CI work.
The database folder stores all the database drivers and class which enable you to connect to database.
The fonts folder stores all the fonts which can be used by the image manipulation library.
The helpers folder stores all of CI's core helpers but you can place your own helpers
in here which can be accessed by all of your applications.
The language folder stores all of CI's core language files which its libraries and helpers
use. You can also put your own language folders which can accessed by all of your applications.
The libraries folder stores all of CI's core libraries but you can place your own libraries
in here which can be accessed by all of your applications
The logs folder stores all of the logs generated by CI.
The plugin folder stores all of the plugins which you can use. Plugins are almost identical.
to helpers, plugins are functions intended to be shared by the community.
The user_guide houses the user guide to CI.
The index.php file is the bit that does all the CI magic it also lets the you change the name of the system and application folders.
Step 3. The next step is to Open the application/config/config.php file with any text editor and set your base URL.
1. $config['base_url'] = "http://localhost/ci/";
Step 4. If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'myci',
'dbdriver' => 'mysqli',
);
Additionally, since we will be using the database quite a bit, we want it to auto load so that we don't have to specifically load it each time we connect. Open the system/application/config/autoload.php fileand add 'database' to the autoload libaries array.
1
$autoload['libraries'] = array('database');
Step 5. We'll do a quick test to see if CI is up and running properly. Go to http://localhost/ci/
In this blog, I'll show you the directory structure of CI folder and how to Install Codeigniter into your localhost.
Key concepts about CodeIgniter - :
Framework with a small footprint.
MVC approach to web development.
Open Source.
Simple to configure.
Gives exceptional performance.
Offers broad compatibility with standard hosting accounts that run a variety of PHP versions and configurations.
Framework that requires nearly zero configuration.
Suited for complex solutions.
Clear and thorough documentation.
Makes coding in PHP simple and easy.
Step 1. Download CodeIgniter by going to this link: http://codeigniter.com/downloads/.
Step 2. Unzip the package to the htdocs directory of your Web Server or extract it to a directory in your local machine and copy and paste it under htdocs.
File Structure Overview - :
The Codeigniter Directory folder stores all the files which make CI work.
The application folder is almost identical to the contents of the system folder
this is so the user can have files that are particular to that application, for example if a
user only wanted to load a helper in one application he would place it in the system/application/helpers folder instead of the system/helpers folder.
The config folder stores all the config files relevant to the application. Which
includes information on what libraries the application should auto load and database details.
The controllers folder stores all the controllers for the application.
The errors folder stores all the template error pages for the application. When
an error occurs the error page is generated from one of these templates.
The helpers folder stores all the helpers which are specific to your application.
The hooks folder is for hooks which modify the functioning of CI's core files,
hooks should only be used by advanced users of CI
The language folder stores lines of text which can be loaded through the language
library to create multilingual sites.
The libraries folder stores all the libraries which are specific to your application.
The models folder stores all the models for the application.
The views folder stores all the views for the application
The System folder contains these files.
The cache folder stores all the caches generated by the caching library.
The codeigniter folder stores all the internals which make CI work.
The database folder stores all the database drivers and class which enable you to connect to database.
The fonts folder stores all the fonts which can be used by the image manipulation library.
The helpers folder stores all of CI's core helpers but you can place your own helpers
in here which can be accessed by all of your applications.
The language folder stores all of CI's core language files which its libraries and helpers
use. You can also put your own language folders which can accessed by all of your applications.
The libraries folder stores all of CI's core libraries but you can place your own libraries
in here which can be accessed by all of your applications
The logs folder stores all of the logs generated by CI.
The plugin folder stores all of the plugins which you can use. Plugins are almost identical.
to helpers, plugins are functions intended to be shared by the community.
The user_guide houses the user guide to CI.
The index.php file is the bit that does all the CI magic it also lets the you change the name of the system and application folders.
Step 3. The next step is to Open the application/config/config.php file with any text editor and set your base URL.
1. $config['base_url'] = "http://localhost/ci/";
Step 4. If you intend to use a database, open the application/config/database.php file with a text editor and set your database settings.
$db['default'] = array(
'dsn' => '',
'hostname' => 'localhost',
'username' => 'root',
'password' => '',
'database' => 'myci',
'dbdriver' => 'mysqli',
);
Additionally, since we will be using the database quite a bit, we want it to auto load so that we don't have to specifically load it each time we connect. Open the system/application/config/autoload.php fileand add 'database' to the autoload libaries array.
1
$autoload['libraries'] = array('database');
Step 5. We'll do a quick test to see if CI is up and running properly. Go to http://localhost/ci/
0 comments:
Post a Comment