Your SlideShare is downloading. ×
0
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Codeigniter
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Codeigniter

10,066

Published on

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

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

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CodeIgniter Prepared : Nguyen Tien Chinh & Bùi Cát Hưng 14/01/2010
  • 2. Porpuse : Introduction new other PHP framework. Compare other Php Framework. Setup and Deploys project. Attendees : Technology members. Duration : 45’
  • 3. After the seminar, attendees will achieve : -Understand what is CodeIgniter framework -Architect of CI -Deploy a project with it
  • 4. Introduction to CodeIgniter. Structure and architect Overview CI . Demo
  • 5. Introduction to CodeIgniter <ul><li>What is CodeIgniter. </li></ul><ul><li>Architecture. </li></ul><ul><li>Advantages and Disavantages </li></ul>
  • 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. 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. MVC model
  • 9. Its architecture.
  • 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. 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. &nbsp;
  • 13. Introduction to CodeIgniter. Core of Framework. Overview CI Demo
  • 14. Core CI <ul><li>Libraries </li></ul><ul><li>Helpers </li></ul><ul><li>Document </li></ul>
  • 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>
  • 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>
  • 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>
  • 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>
  • 19. Introduction to CodeIgniter. Core of Framework. Overview CI Demo
  • 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>
  • 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&amp;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>
  • 22. URI Routing <ul><li>Wildcards </li></ul><ul><ul><li>$route[&apos;product/:num&apos;] = &amp;quot;catalog/product_lookup&amp;quot;; </li></ul></ul><ul><li>Regular Expressions </li></ul><ul><ul><li>$route[&apos;products/([a-z]+)/(d+)&apos;] = &amp;quot;$1/id_$2&amp;quot;; </li></ul></ul>
  • 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[&apos;tpl_view&apos;] = &apos;news/index&apos;; </li></ul></ul><ul><ul><li>$data[&apos;active_tab&apos;] = &apos;news&apos;; </li></ul></ul><ul><ul><li>$this-&gt;load-&gt;view(&apos;layout&apos;,$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>
  • 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-&gt;db-&gt;select(&apos;id,username&apos;); </li></ul></ul><ul><ul><li>$this-&gt;db-&gt;from(&apos;admin&apos;); </li></ul></ul><ul><ul><li>$this-&gt;db-&gt;where(&apos;username&apos;, $username); </li></ul></ul><ul><ul><li>$this-&gt;db-&gt;where(&apos;password&apos;, $password); </li></ul></ul><ul><ul><li>$this-&gt;db-&gt;where(&apos;active&apos;, &apos;Yes&apos;); </li></ul></ul><ul><ul><li>$this-&gt;db-&gt;limit(1); </li></ul></ul><ul><ul><li>$Q = $this-&gt;db-&gt;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>
  • 25. Views <ul><li>&lt;?php $this- &gt;load-&gt;view(&apos;header&apos;); ?&gt; </li></ul><ul><li>&lt;!-- Set view for Project --&gt; </li></ul><ul><li>&lt;?php $this- &gt;load-&gt;view ($tpl_view ); ?&gt; </li></ul><ul><li>&lt;!-- End set view --&gt; </li></ul><ul><li>&lt;?php $this- &gt;load-&gt;view(&apos;footer&apos;); ?&gt; </li></ul>
  • 26. Auto-loading Resources <ul><li>libraries, helpers, and plugins to be initialized automatically every time the system runs. </li></ul><ul><li>$autoload[&apos;libraries&apos;] = array(&apos;database&apos;, &apos;session&apos;, &apos;validation&apos;); </li></ul><ul><li>$autoload[&apos;helper&apos;] = array(&apos;url&apos;); </li></ul>
  • 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>
  • 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>
  • 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>
  • 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>
  • 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>
  • 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
  • 33. Introduction to CodeIgniter. Core of Framework. Overview CI Demo
  • 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>
  • 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>
  • 36. Thanks for your attend

×