Presenters:
Awais Hammed
Ayaz Farid Shah
Samiya Rafique
What is Framework??
A PHP framework is a basic platform that allows us to
develop web applications.
Benefits of using Framework:
 Its easy to handle the complex problems easily.
 Standardization
 Security
 Extensibility
 Fast Loading
 Reusable of code
 Increase Flexibility
Top 10 Frameworks
 Codeigniter
 Yii
 CakePHP
 Zend
 Symfony
 PHPDevShell
 Prado
 Akelos
 Zoop
 QPHP
Introduction
 PHP Web Application Frameworks
 Open Source
 Rapid Development up to 50%
 Originally Released in 2006
 Recommended by Rasmus Lerdof
Why choose codeigniter
 Light Weight
 Fast Performance
 Little Configuration
 Little Server Requirements
 Easy to Understand
 No installation Necessary
 Built in Security tools
Database Abstraction
Why use Framework (LikeCodeigniter )
Reusability
Avoid Copy/Paste
Reuse codes in multiple projects
Maintainability
Anyone can extend or edit your application
Codeigniter follow MVC
World’s best framework follows MVC Architecture
Reasons:
 Organize code
 Logics
 Application divide into(Model-View-Controller )
What should you know
 HTML
 CSS
 PHP
 MY SQL
Directory Structure
Application Folder
 Cache
 Config
 Controllers
 Core
 Helpers
 Languages
 Libraries
 Logs
 Models
 Third party
 View
Directory Structure (Cont.…)
System Folder
 Core
 Database
 Fonts
 Helpers
 Languages
 Libraries
Directory Structure (Cont.…)
User Guide Folder
 Index.html
Codeigniter Architecture
Codeigniter Classes
CI’s built-in classes contain the basic functionality that are frequently
used by web applications.
The most-used classes are 5:
 Database
 Input
 Loader
 URI
 Validation
Database Class
 Codeigniter provides a simple way to access the database.
 Generates queries using the Active Record(insert, update and
retrieve with minimal scripting ) Pattern.
 Provides method “chaining” for easy query building
 $this->db.->where(‘name’,$name);
Input Class
The Input Class serves two purposes:
 It pre-processes global input data for security.
 It provides some helper methods for fetching input data and pre-processing it.
Input Filtering
 Security Filtering
 XSS Filtering( prevent cross-site scripting attacks)
 Assessing form data
 $this->input->post();
 $this->input->get();
 $this->input->cookie();
 $this->input->server();
Loader Class(Theseelementscanbelibraries(classes))
Loader, as the name suggests, is used to load elements. These elements can
be libraries (classes) View files, Drivers, Helpers, Models, or your own files
like.
 Databases
Views
 Helpers (small php functions)
 Plugins (is a piece of software that acts as an add-on to a web browser and
gives the browser additional functionality.)
 $this->load->view(‘viewname’);
URI(UniformResourcesIdentifier) Class
The URI Class provides methods that help you retrieve information from
your URI strings.
Provides access to specific parts of the URI string.
Typically there is a one-to-one relationship between a URI string and its
corresponding controller class/method.
 $this->uri->segment(n);
Validation Class
Helps validate user form input
 Required fields
 Required string formatting (length,)
Enables success and failure messages on form submittal
form submittal
Creating Libraries
 Libraries are similar to helpers.
 You can create entirely new libraries.
 You can extend native libraries.
 You can replace native libraries.
Steps for creating a “Hello World”
program in CI
References
 PHP framework comparison benchmarks
 http://avnetlabs.com/php/php-framework-comparison-
benchmarks
 Why Should we use a PHP Framework?
 http://www.ashesh.com.np/why-should-we-use-a-php-
framework/
 CakePHP official site
 http://cakephp.org/
 CodeIgniter Site
 http://codeigniter.com
 PHP frameworks lists
 http ://www.phpframeworks.com/
 http://www.phpwact.org/pattern/model_view_co
ntroller
Ask Question:
Codeigniter

Codeigniter

  • 2.
  • 4.
    What is Framework?? APHP framework is a basic platform that allows us to develop web applications. Benefits of using Framework:  Its easy to handle the complex problems easily.  Standardization  Security  Extensibility  Fast Loading  Reusable of code  Increase Flexibility
  • 5.
    Top 10 Frameworks Codeigniter  Yii  CakePHP  Zend  Symfony  PHPDevShell  Prado  Akelos  Zoop  QPHP
  • 6.
    Introduction  PHP WebApplication Frameworks  Open Source  Rapid Development up to 50%  Originally Released in 2006  Recommended by Rasmus Lerdof
  • 7.
    Why choose codeigniter Light Weight  Fast Performance  Little Configuration  Little Server Requirements  Easy to Understand  No installation Necessary  Built in Security tools Database Abstraction
  • 8.
    Why use Framework(LikeCodeigniter ) Reusability Avoid Copy/Paste Reuse codes in multiple projects Maintainability Anyone can extend or edit your application
  • 9.
    Codeigniter follow MVC World’sbest framework follows MVC Architecture Reasons:  Organize code  Logics  Application divide into(Model-View-Controller )
  • 10.
    What should youknow  HTML  CSS  PHP  MY SQL
  • 11.
    Directory Structure Application Folder Cache  Config  Controllers  Core  Helpers  Languages  Libraries  Logs  Models  Third party  View
  • 12.
    Directory Structure (Cont.…) SystemFolder  Core  Database  Fonts  Helpers  Languages  Libraries
  • 13.
    Directory Structure (Cont.…) UserGuide Folder  Index.html
  • 14.
  • 15.
    Codeigniter Classes CI’s built-inclasses contain the basic functionality that are frequently used by web applications. The most-used classes are 5:  Database  Input  Loader  URI  Validation
  • 16.
    Database Class  Codeigniterprovides a simple way to access the database.  Generates queries using the Active Record(insert, update and retrieve with minimal scripting ) Pattern.  Provides method “chaining” for easy query building  $this->db.->where(‘name’,$name);
  • 17.
    Input Class The InputClass serves two purposes:  It pre-processes global input data for security.  It provides some helper methods for fetching input data and pre-processing it. Input Filtering  Security Filtering  XSS Filtering( prevent cross-site scripting attacks)  Assessing form data  $this->input->post();  $this->input->get();  $this->input->cookie();  $this->input->server();
  • 18.
    Loader Class(Theseelementscanbelibraries(classes)) Loader, asthe name suggests, is used to load elements. These elements can be libraries (classes) View files, Drivers, Helpers, Models, or your own files like.  Databases Views  Helpers (small php functions)  Plugins (is a piece of software that acts as an add-on to a web browser and gives the browser additional functionality.)  $this->load->view(‘viewname’);
  • 19.
    URI(UniformResourcesIdentifier) Class The URIClass provides methods that help you retrieve information from your URI strings. Provides access to specific parts of the URI string. Typically there is a one-to-one relationship between a URI string and its corresponding controller class/method.  $this->uri->segment(n);
  • 20.
    Validation Class Helps validateuser form input  Required fields  Required string formatting (length,) Enables success and failure messages on form submittal form submittal
  • 21.
    Creating Libraries  Librariesare similar to helpers.  You can create entirely new libraries.  You can extend native libraries.  You can replace native libraries.
  • 22.
    Steps for creatinga “Hello World” program in CI
  • 23.
    References  PHP frameworkcomparison benchmarks  http://avnetlabs.com/php/php-framework-comparison- benchmarks  Why Should we use a PHP Framework?  http://www.ashesh.com.np/why-should-we-use-a-php- framework/  CakePHP official site  http://cakephp.org/  CodeIgniter Site  http://codeigniter.com  PHP frameworks lists  http ://www.phpframeworks.com/  http://www.phpwact.org/pattern/model_view_co ntroller
  • 24.