Professional Documents
Culture Documents
Web Application Development 2 1: Why Use Codeigniter or Ci
Web Application Development 2 1: Why Use Codeigniter or Ci
1
Introduction
Introduction
Introduction
Learning and Development in PHP is simple. CodeIgniter – “a powerful PHP
framework with a very small footprint, built for developers who need a
simple and elegant toolkit to create full-featured web applications.” It sounds
very complex but it’s pretty straightforward.
CodeIgniter is developed by Ellislab and used by millions worldwide.
Developers prefer to use CI for its rapid application development. It has rich
and reusable libraries and class for your website’s foundation.
Instead of creating your website from native PHP scratch, why not make it
more organized and powerful using CodeIgniter.
Skills needed
The following are the items you need to know before starting to play around
CI.
PHP – A good understanding of the PHP language is a must. As long as you
can perform simple instructions (e.g. variable declaration/assignments,
conditions, loops), you will nearly understand everything here since the
CodeIgniter is made up of PHP!
Course Module
HTML – Well, you do need those html elements to manipulate to. You’ll use
this for the layout design, inputs and presentation of data.
CSS – It’s good if you know Cascading Style Sheets (CSS), and even better if
you’re using external style sheets. There are more web design processors
available if you want to level-up your knowledge on styling however if you
don’t know how, still, you can learn CI.
MySQL – This means your SQL Basic queries are required. There will some
modules on this book where you need to manipulate I/O (inputs and
outputs) from your data storage or your database. Models communicate with
the database and uses your fundamental knowledge on SQL.
JavaScript – It makes the website interact with the HTML elements. If you do
not know JS, maybe learn it sometime, okay? You need these for future
developments.
CI Installation
Step 1. Visit its website on https://www.codeigniter.com/
Step 2. Find your way to the Download link and click Download.
The current version is 3.0.6
Step 3. Extract the downloaded .zip file and place it on your local server.
Make sure your Apache server is running and online then do:
Web Application Development 2
3
Introduction
Step 4. If you can see this Welcome Message. Your installation was a
success!
Course Module
Controller – This contains the Business logic (Business Logic Layer). The
controller controls the Model and View. A controller is a class that contains
methods that decides what to call, or perform and display.
When a user sends a request on a browser, the controller will determine the
process and perform tasks based on its method; it includes calling a method
returning a value from a model, displaying and passing values on a view or
showing a 404 error page.
Views – The Presentation layer. This contains designs, layouts or templates. It
is the collection of what will show up on your browser. The view is where the
user sees and interacts with.
Models – It is also referred as the Data Access Layer. The Model
communicates with your database. It comprises of methods that execute
queries using the CodeIgniter’s Active Record pattern.
CI Directory
Basically, CodeIgniter has 3 main folders: Application, System and User
Guide. You will work with your website in Application Folder. The System
folder, keep it a habit to avoid making changes to any of the files inside. It
contains the CodeIgniter’s core files which is necessary to make it run.
User_Guide contains the offline documentations you need in developing with
websites in CI.
Web Application Development 2
5
Introduction
Course Module
• Logs: This directory will include all application logs. TO know how to
write log for debug/error/info, please more about error handling
• Migrations: This directory will include migration helpers.
• Models: This directory will include all model classes used in our
application. This section can be said as the ‘data access layer’ of our
application.
• Third_party : This directory will include library files, but only those,
which are imported from third-party. So, difference between the
‘third_party’ and ‘libraries’ is that, one is for self-made libraries, for
app specific, other one is for importing party libraries.
• Views : This directory will include all view template files.