Codeigniter

3,224 views

Published on

The presentation i gave about CodeIgniter at ROSDEV in Bucharest on the 12th of April 2008

Published in: Technology
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
3,224
On SlideShare
0
From Embeds
0
Number of Embeds
43
Actions
Shares
0
Downloads
141
Comments
0
Likes
1
Embeds 0
No embeds

No notes for slide

Codeigniter

  1. 1. CodeIgniter ROSDEV, 12 Aprilie 2008 Bodi Zsolt
  2. 2. eu <ul><li>Ma numesc Bodi Zsolt </li></ul><ul><ul><li>Tg. Mures </li></ul></ul><ul><ul><li>student(part-time) la UPM </li></ul></ul><ul><ul><li>Lead Developer @ MedeeaWeb Works (medeaaweb.com) </li></ul></ul><ul><ul><li>CTO Off/On Studio (www.offonstudio.com) </li></ul></ul><ul><ul><li>folosesc CI de 5 luni </li></ul></ul>
  3. 3. Cum faceam site-uri? (the “good” old times)
  4. 4. asa?
  5. 5. sau poate asa?
  6. 6. E timpul pentru altceva http://codeigniter.com/
  7. 7. CodeIgniter to the rescue <ul><li>Ce este? </li></ul><ul><ul><li>CI este un toolkit pentru oamenii care vor sa faca aplicatii web folosind PHP </li></ul></ul><ul><li>este mic </li></ul><ul><li>este rapid </li></ul><ul><ul><li>creatorii lui va provoaca sa gasiti un framework mai rapid </li></ul></ul><ul><li>MVC </li></ul>
  8. 8. Sa vorbim un pic despre MVC ¿Dónde está el baño?
  9. 9. MV si mai cum?
  10. 10. MVC <ul><li>View (views/frog_count.php) </li></ul><ul><ul><li><html> </li></ul></ul><ul><ul><li><body> </li></ul></ul><ul><ul><ul><li><h1> You’ve <?=$froggies;?> items in list</h1> </li></ul></ul></ul><ul><ul><ul><li></body> </li></ul></ul></ul><ul><ul><li></html> </li></ul></ul><ul><li>Controller (controllers/my_controller.php) </li></ul><ul><ul><li>function total_frogs () { </li></ul></ul><ul><ul><ul><li>$this->load->model(“frogs”); </li></ul></ul></ul><ul><ul><ul><li>$number_of_frogs = $this->frogs->count_frogs(); </li></ul></ul></ul><ul><ul><ul><li>$data[‘froggies’] = $number_of_frogs; </li></ul></ul></ul><ul><ul><ul><li>$this->load->view(“frog_view”, $data); </li></ul></ul></ul><ul><ul><li>} </li></ul></ul><ul><li>Model (models/frogs.php) </li></ul><ul><ul><li>function count_frogs() { </li></ul></ul><ul><ul><ul><li>$this->db->where(“type”,”frog”); </li></ul></ul></ul><ul><ul><ul><li>$this->db->from(“animals”); </li></ul></ul></ul><ul><ul><ul><li>$query = $this->db->get(); </li></ul></ul></ul><ul><ul><ul><li>return $query->num_rows(); </li></ul></ul></ul><ul><ul><ul><li>} </li></ul></ul></ul>Model View Controller
  11. 11. Cum se apeleaza? <ul><li>http:// www.my_server.com/index.php/my_controller/my_frogs </li></ul>Serverul unde e instalat CI controllerul: System/application/controllers/my_controller.php Numele metodei din acel controller
  12. 12. Demo (Un demo valoreaza cat 1000 de slide-uri)
  13. 13. Classes Benchmarking Calendaring Database Email Encryption File Uploading FTP HTML Table Image Manipulation Input and Security Pagination Session Trackback Template Parser Unit Testing URI User Agent Validation
  14. 14. Helpers Array Cookie Date Download File Form HTML Security Smiley String Text Typography URL XML
  15. 15. Link-uri utile <ul><li>www.codeigniter.com </li></ul><ul><li>www.kohanaphp.com(PHP5) </li></ul><ul><li>codeigniter.com/wiki/ </li></ul><ul><li>www.rapyd.com(toolkit ptr toolkit) </li></ul>
  16. 16. Are cineva un foc? <ul><li>slide-urile si demo pe: </li></ul><ul><ul><li>http://www.widgetdev.org/ci/ </li></ul></ul>
  17. 17. Pagina de bun-venit
  18. 18. Baza de Date
  19. 19. Configuram CI
  20. 20. Mai configuram un pic...
  21. 21. Cream controllerul
  22. 22. Si un view
  23. 23. un F5 sa vedem cum stam
  24. 24. Trimitem variabile catre view VIEW CONTROLLER
  25. 25. si…
  26. 26. Model: Get item <ul><li>Folosim ActiveRecord </li></ul>
  27. 27. Model: Put Item
  28. 28. Model: Get all
  29. 29. Model: Delete Item
  30. 30. Controller: Add
  31. 31. View: Add/Edit
  32. 32. User Interface: Add
  33. 33. Controller: Save
  34. 34. Controller: Edit
  35. 35. User Interface: Edit
  36. 36. Controller: List all
  37. 37. Views: List <ul><li>Putem sa folosim cod PHP in view-uri, nu trebuie sa invatam nici un limbaj de templateing </li></ul>
  38. 38. User Interface: List
  39. 39. Controller: Delete
  40. 40. Views: Delete Confirm
  41. 41. User Interface: Delete

×