CodeIgniter Prepared : Nguyen Tien Chinh & Bùi Cát Hưng 14/01/2010
Porpuse :  Introduction new other PHP framework.   Compare other Php Framework. Setup and Deploys project.   Attendees :  ...
After the seminar, attendees will achieve : -Understand what is CodeIgniter framework -Architect of CI -Deploy a project w...
Introduction  to CodeIgniter.  Structure and architect  Overview CI .  Demo
Introduction to CodeIgniter <ul><li>What is CodeIgniter. </li></ul><ul><li>Architecture. </li></ul><ul><li>Advantages and ...
<ul><li>CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP.  </li>...
CodeIgniter Feature  <ul><li>Runs on PHP 4 </li></ul><ul><li>Light Weight </li></ul><ul><li>Fast </li></ul><ul><li>Uses M-...
MVC model
Its architecture.
Advantages of CodeIgniter <ul><li>Helpers and libraries. </li></ul><ul><li>Support PHP 4 or PHP. </li></ul><ul><li>Excepti...
Disadvantages of Codeigniter <ul><li>ORM  is not  available </li></ul><ul><li>Modules  </li></ul><ul><li>Auth Module  </li...
 
Introduction  to CodeIgniter.  Core of Framework.  Overview CI   Demo
Core CI <ul><li>Libraries </li></ul><ul><li>Helpers </li></ul><ul><li>Document </li></ul>
Libraries <ul><li>Benchmarking Class   </li></ul><ul><li>Calendar Class   </li></ul><ul><li>Cart Class   </li></ul><ul><li...
Libraries <ul><li>Input and Security Class   </li></ul><ul><li>Loader Class   </li></ul><ul><li>Language Class   </li></ul...
Helpers <ul><li>Array Helper   </li></ul><ul><li>Compatibility Helper   </li></ul><ul><li>Cookie Helper   </li></ul><ul><l...
Helpers <ul><li>Inflector Helper   </li></ul><ul><li>Language Helper   </li></ul><ul><li>Number Helper   </li></ul><ul><li...
Introduction  to CodeIgniter.  Core of Framework.  Overview CI   Demo
Overview CI framwork <ul><li>CodeIgniter URLs </li></ul><ul><li>URI Routing </li></ul><ul><li>Controllers  </li></ul><ul><...
CodeIgniter URLs <ul><li>segment-based </li></ul><ul><ul><li>example.com/ class / function / ID   </li></ul></ul><ul><li>q...
URI Routing <ul><li>Wildcards </li></ul><ul><ul><li>$route['product/:num'] = &quot;catalog/product_lookup&quot;;  </li></u...
Controllers <ul><li>class News extends Controller { </li></ul><ul><li>function News() { </li></ul><ul><ul><li>parent::Cont...
Models <ul><li>class NewsDAO extends Model { </li></ul><ul><li>function NewsDAO () { </li></ul><ul><ul><li>parent::Model()...
Views <ul><li><?php   $this- >load->view('header'); ?> </li></ul><ul><li><!-- Set view for Project --> </li></ul><ul><li><...
Auto-loading Resources <ul><li>libraries, helpers, and plugins to be initialized automatically every time the system runs....
Managing your Applications <ul><li>to have multiple sets of applications that share a single CodeIgniter installation </li...
Security <ul><li>URI Security </li></ul><ul><li>GET, POST, and COOKIE Data </li></ul><ul><li>XSS Filtering </li></ul><ul><...
Directory structure of CI <ul><li>+System </li></ul><ul><ul><li>- Application  ( Working with project here ) </li></ul></u...
<ul><li>+Application </li></ul><ul><ul><ul><li>-Controller </li></ul></ul></ul><ul><ul><ul><ul><li>-  News.php </li></ul><...
Compare other PHP framework <ul><li>CodeIgniter vs Cake? </li></ul><ul><li>CodeIgniter vs Zend Framework. </li></ul><ul><l...
Compare other PHP framework EDP : Event Driven Programming.New! ORM : Indicates whether the framework supports an object-r...
Introduction  to CodeIgniter.  Core of Framework.  Overview CI   Demo
Bonus <ul><li>Template Library </li></ul><ul><li>Link download: </li></ul><ul><ul><li>http:// www.williamsconcepts.com/ci/...
References <ul><li>http://www.codeigniterdirectory.com </li></ul><ul><li>http:// codeigniter.com/user_guide </li></ul><ul>...
Thanks for your attend
Upcoming SlideShare
Loading in...5
×

Codeigniter

10,405

Published on

0 Comments
7 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
10,405
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
379
Comments
0
Likes
7
Embeds 0
No embeds

No notes for slide

Codeigniter

  1. 1. CodeIgniter Prepared : Nguyen Tien Chinh & Bùi Cát Hưng 14/01/2010
  2. 2. Porpuse : Introduction new other PHP framework. Compare other Php Framework. Setup and Deploys project. Attendees : Technology members. Duration : 45’
  3. 3. After the seminar, attendees will achieve : -Understand what is CodeIgniter framework -Architect of CI -Deploy a project with it
  4. 4. Introduction to CodeIgniter. Structure and architect Overview CI . Demo
  5. 5. Introduction to CodeIgniter <ul><li>What is CodeIgniter. </li></ul><ul><li>Architecture. </li></ul><ul><li>Advantages and Disavantages </li></ul>
  6. 6. <ul><li>CodeIgniter is an Application Development Framework - a toolkit - for people who build web sites using PHP. </li></ul><ul><li>CodeIgniter is open source. </li></ul><ul><li>Was built by EllisLab. </li></ul><ul><li>The first public version of CodeIgniter was released on February 28, 2006. </li></ul>What is CodeIgninter
  7. 7. CodeIgniter Feature <ul><li>Runs on PHP 4 </li></ul><ul><li>Light Weight </li></ul><ul><li>Fast </li></ul><ul><li>Uses M-V-C </li></ul><ul><li>Clean URLs </li></ul><ul><li>Packs a Punch </li></ul><ul><li>Extensible </li></ul><ul><li>Friendly Community of Users </li></ul><ul><li>Thoroughly Documented </li></ul>
  8. 8. MVC model
  9. 9. Its architecture.
  10. 10. Advantages of CodeIgniter <ul><li>Helpers and libraries. </li></ul><ul><li>Support PHP 4 or PHP. </li></ul><ul><li>Exceptional performance. </li></ul><ul><li>Lightweight. </li></ul><ul><li>Very fast. </li></ul><ul><li>Clear document. </li></ul>
  11. 11. Disadvantages of Codeigniter <ul><li>ORM is not available </li></ul><ul><li>Modules </li></ul><ul><li>Auth Module </li></ul><ul><li>Ajax </li></ul>
  12. 13. Introduction to CodeIgniter. Core of Framework. Overview CI Demo
  13. 14. Core CI <ul><li>Libraries </li></ul><ul><li>Helpers </li></ul><ul><li>Document </li></ul>
  14. 15. Libraries <ul><li>Benchmarking Class </li></ul><ul><li>Calendar Class </li></ul><ul><li>Cart Class </li></ul><ul><li>Config Class </li></ul><ul><li>Database Class </li></ul><ul><li>Email Class </li></ul><ul><li>Encryption Class </li></ul><ul><li>File Uploading Class </li></ul><ul><li>Form Validation Class </li></ul><ul><li>FTP Class </li></ul><ul><li>HTML Table Class </li></ul><ul><li>Image Manipulation Class </li></ul>
  15. 16. Libraries <ul><li>Input and Security Class </li></ul><ul><li>Loader Class </li></ul><ul><li>Language Class </li></ul><ul><li>Output Class </li></ul><ul><li>Pagination Class </li></ul><ul><li>Session Class </li></ul><ul><li>Trackback Class </li></ul><ul><li>Template Parser Class </li></ul><ul><li>Typography Class </li></ul><ul><li>Unit Testing Class </li></ul><ul><li>URI Class </li></ul><ul><li>User Agent Class </li></ul><ul><li>XML-RPC Class </li></ul><ul><li>Zip Encoding Class </li></ul>
  16. 17. Helpers <ul><li>Array Helper </li></ul><ul><li>Compatibility Helper </li></ul><ul><li>Cookie Helper </li></ul><ul><li>Date Helper </li></ul><ul><li>Directory Helper </li></ul><ul><li>Download Helper </li></ul><ul><li>Email Helper </li></ul><ul><li>File Helper </li></ul><ul><li>Form Helper </li></ul><ul><li>HTML Helper </li></ul>
  17. 18. Helpers <ul><li>Inflector Helper </li></ul><ul><li>Language Helper </li></ul><ul><li>Number Helper </li></ul><ul><li>Path Helper </li></ul><ul><li>Security Helper </li></ul><ul><li>Smiley Helper </li></ul><ul><li>String Helper </li></ul><ul><li>Text Helper </li></ul><ul><li>Typography Helper </li></ul><ul><li>URL Helper </li></ul><ul><li>XML Helpe </li></ul>
  18. 19. Introduction to CodeIgniter. Core of Framework. Overview CI Demo
  19. 20. Overview CI framwork <ul><li>CodeIgniter URLs </li></ul><ul><li>URI Routing </li></ul><ul><li>Controllers </li></ul><ul><li>Models </li></ul><ul><li>Views </li></ul><ul><li>Auto-loading Resources </li></ul><ul><li>Security </li></ul><ul><li>Managing your Applications </li></ul>
  20. 21. CodeIgniter URLs <ul><li>segment-based </li></ul><ul><ul><li>example.com/ class / function / ID </li></ul></ul><ul><li>query string </li></ul><ul><ul><li>example.com/index.php?c=controller&m=method </li></ul></ul><ul><li>Adding a URL Suffix </li></ul><ul><ul><li>example.com/index.php/products/view/shoes.html </li></ul></ul>
  21. 22. URI Routing <ul><li>Wildcards </li></ul><ul><ul><li>$route['product/:num'] = &quot;catalog/product_lookup&quot;; </li></ul></ul><ul><li>Regular Expressions </li></ul><ul><ul><li>$route['products/([a-z]+)/(d+)'] = &quot;$1/id_$2&quot;; </li></ul></ul>
  22. 23. Controllers <ul><li>class News extends Controller { </li></ul><ul><li>function News() { </li></ul><ul><ul><li>parent::Controller(); </li></ul></ul><ul><li>} </li></ul><ul><li>function index() { </li></ul><ul><ul><li>$data['tpl_view'] = 'news/index'; </li></ul></ul><ul><ul><li>$data['active_tab'] = 'news'; </li></ul></ul><ul><ul><li>$this->load->view('layout',$data); </li></ul></ul><ul><li>} </li></ul><ul><li>Function otherFunction($para1, $para2){ </li></ul><ul><ul><li>// process data and set view here </li></ul></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  23. 24. Models <ul><li>class NewsDAO extends Model { </li></ul><ul><li>function NewsDAO () { </li></ul><ul><ul><li>parent::Model(); </li></ul></ul><ul><li>} </li></ul><ul><li>function verifyUser($username,$password){ </li></ul><ul><ul><li>$this->db->select('id,username'); </li></ul></ul><ul><ul><li>$this->db->from('admin'); </li></ul></ul><ul><ul><li>$this->db->where('username', $username); </li></ul></ul><ul><ul><li>$this->db->where('password', $password); </li></ul></ul><ul><ul><li>$this->db->where('active', 'Yes'); </li></ul></ul><ul><ul><li>$this->db->limit(1); </li></ul></ul><ul><ul><li>$Q = $this->db->get(); </li></ul></ul><ul><ul><li>return $Q; </li></ul></ul><ul><ul><li>} </li></ul></ul><ul><li>Function otherFunction($para1, $para2){ </li></ul><ul><ul><li>// process data} </li></ul></ul><ul><li>} </li></ul>
  24. 25. Views <ul><li><?php $this- >load->view('header'); ?> </li></ul><ul><li><!-- Set view for Project --> </li></ul><ul><li><?php $this- >load->view ($tpl_view ); ?> </li></ul><ul><li><!-- End set view --> </li></ul><ul><li><?php $this- >load->view('footer'); ?> </li></ul>
  25. 26. Auto-loading Resources <ul><li>libraries, helpers, and plugins to be initialized automatically every time the system runs. </li></ul><ul><li>$autoload['libraries'] = array('database', 'session', 'validation'); </li></ul><ul><li>$autoload['helper'] = array('url'); </li></ul>
  26. 27. Managing your Applications <ul><li>to have multiple sets of applications that share a single CodeIgniter installation </li></ul><ul><li>FrontEnd. </li></ul><ul><li>BackEnd. </li></ul><ul><li>… .. </li></ul>
  27. 28. Security <ul><li>URI Security </li></ul><ul><li>GET, POST, and COOKIE Data </li></ul><ul><li>XSS Filtering </li></ul><ul><li>Validate the data </li></ul><ul><li>Escape all data before database insertion </li></ul>
  28. 29. Directory structure of CI <ul><li>+System </li></ul><ul><ul><li>- Application ( Working with project here ) </li></ul></ul><ul><ul><li>-Codeigniter </li></ul></ul><ul><ul><li>-Helper </li></ul></ul><ul><ul><li>-Libraries </li></ul></ul><ul><ul><li>-Database </li></ul></ul><ul><ul><li>-Language </li></ul></ul>
  29. 30. <ul><li>+Application </li></ul><ul><ul><ul><li>-Controller </li></ul></ul></ul><ul><ul><ul><ul><li>- News.php </li></ul></ul></ul></ul><ul><ul><ul><li>-Model </li></ul></ul></ul><ul><ul><ul><ul><li>- NewsDAO.php </li></ul></ul></ul></ul><ul><ul><ul><li>-View </li></ul></ul></ul><ul><ul><ul><ul><li>News.php </li></ul></ul></ul></ul>
  30. 31. Compare other PHP framework <ul><li>CodeIgniter vs Cake? </li></ul><ul><li>CodeIgniter vs Zend Framework. </li></ul><ul><li>http:// www.phpframeworks.com/index.php </li></ul>
  31. 32. Compare other PHP framework EDP : Event Driven Programming.New! ORM : Indicates whether the framework supports an object-record mapper, usually an implementation of ActiveRecord. Documentation / User Guide ? Result Benchmark CodeIgniter: 58.51 CakePHP: 37.46 29.67 Symfony: 22.78
  32. 33. Introduction to CodeIgniter. Core of Framework. Overview CI Demo
  33. 34. Bonus <ul><li>Template Library </li></ul><ul><li>Link download: </li></ul><ul><ul><li>http:// www.williamsconcepts.com/ci/codeigniter/libraries/template/download. html </li></ul></ul><ul><li>Introduction template library. </li></ul><ul><li>Demo template library </li></ul>
  34. 35. References <ul><li>http://www.codeigniterdirectory.com </li></ul><ul><li>http:// codeigniter.com/user_guide </li></ul><ul><li>http://www.phpframeworks.com </li></ul><ul><li>Professional CodeIgniter - book </li></ul>
  35. 36. Thanks for your attend
  1. Gostou de algum slide específico?

    Recortar slides é uma maneira fácil de colecionar informações para acessar mais tarde.

×