Who am I?Leng Sheng Hong• The author of DooPHP framework.• Had been a Malaysian for the last24 years (experienced)
What is DooPHP?
, how fast?Hmm
Definitely faster than KTM
Benchmark (needs an update)                         http://www.doophp.com/benchmark
Hmm, so is it fastbecause there’s nofeatures?
Features• Sophisticated URI routing      • High Performance• RESTful out of the box         • Database profiling tool• HMV...
Hmm,Why not CakePHP orZend Framework or Symfonyor CodeIgniter or Zoop orAkelos or Yii or PHP on Traxor Prado or Seagull?
Because you have to chooseone, dammitPlus..
How to get started with DooPHP    http://doophp.com/download
How to get started with DooPHPsvn checkout http://doophp.googlecode.com/svn/trunk/ doophp
Read the guide, api doc & blog                 http://doophp.com/docVisit the forum if you have questions & suggestions
Basic app structure
Basic app structure
With HMVC usage           example module
DooPHP MVC Flow
How to start writing my app?   3 ways to write:     • The manual way     • The automated way     • Hybrid
The manual way
Define routes
Create Controller & Action method
View rendering
Output Result
The automated way
What to automate? Auto routing   no more defining in routes.conf.php Auto view rendering   no need to specify a view to be...
Let’s do some tweaksAuto routing1. Remove the routes definition in routes.conf.php2. Set AUTOROUTE to true in common.conf....
Remove the routes definition in routes.conf.phpSet AUTOROUTE to true in common.conf.php
StoreController
TaDa! Same output result
What’s the difference?Manual way  Gives you whole lot of manual controls, good  news for ya’, control freaks! Auto way  Sa...
Hybrid? When?When you’re using auto routing BUT  You want some freaking awesome URLs (for SEO  purpose, maybe)  You want t...
Freaking awesome URL* You won’t be ranked number 1 in Google search that easily though
Redirect some URLs
URLs for your users. http://twitty.com.my/lengDoo this in routes.conf.phpDoo this in UserController
And for some weirdo situation youwould never thought of...
I have a controller
Client tends to mistype the URL‘transactions’ a lot. Now, hewanted to be able to accesspages via ‘transactions’ too       ...
How to do it?
Easiest solution
Another use case for autoroute_aliasWhen you are using auto routing and want a URL structurewhich is deeper than the typic...
Model & Database
Configure db.conf.php
Enable DB in index.php
Database example
Define table relationships (if needed)db.conf.php  No naming convention required, works with any of your existing DBs.
Generate Models
Model usage example
Querying
Model usage example (extends DooModel)
Some list of methods in DooModel
What do you need other thanDooPHP ?
You need to get a life.
and   Probably a good IDE.
NetBeans
Code hinting for DooPHP
Awesome for quick reference
Less is More. I should stop hereand let the Adventurers explore
Questions?   Don’t worry, I won’t eat you                                 http://twitter.com/doophp                       ...
Just Doo IT!
Intro to DooPHP
Intro to DooPHP
Intro to DooPHP
Upcoming SlideShare
Loading in …5
×

Intro to DooPHP

25,582 views
25,385 views

Published on

DooPHP slides for PHP Meetup 2011 Malaysia: Framework Shootout

for android version, visit http://doophp.com/files/intro-to-doophp.apk

special thanks to php.net.my

Published in: Technology
3 Comments
7 Likes
Statistics
Notes
  • Are you there, Mr. Leng Sheng Hong? Have you released a new version of DooPHP since 1.4.1? Kind regards.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • its shown on slide 56. It is netbeans... :)
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • An interesting and easy to follow intro. Just a quick question, what IDE are you using? The screen shot on slide 22 looks lovely.
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
No Downloads
Views
Total views
25,582
On SlideShare
0
From Embeds
0
Number of Embeds
11
Actions
Shares
0
Downloads
322
Comments
3
Likes
7
Embeds 0
No embeds

No notes for slide

Intro to DooPHP

  1. 1. Who am I?Leng Sheng Hong• The author of DooPHP framework.• Had been a Malaysian for the last24 years (experienced)
  2. 2. What is DooPHP?
  3. 3. , how fast?Hmm
  4. 4. Definitely faster than KTM
  5. 5. Benchmark (needs an update) http://www.doophp.com/benchmark
  6. 6. Hmm, so is it fastbecause there’s nofeatures?
  7. 7. Features• Sophisticated URI routing • High Performance• RESTful out of the box • Database profiling tool• HMVC • i18n Internationalization• Authentication • Template engine• Authorization (ACL & RBAC) • PHP 5.3 Namespace support• Data caching • 100% E_STRICT compliant• Frontend caching • auto loading• Form generation & validation • Model class generation• Database ORM • CLI support• Database replication • new BSD license• Logging & Profiling tools • simple code & easy to extend
  8. 8. Hmm,Why not CakePHP orZend Framework or Symfonyor CodeIgniter or Zoop orAkelos or Yii or PHP on Traxor Prado or Seagull?
  9. 9. Because you have to chooseone, dammitPlus..
  10. 10. How to get started with DooPHP http://doophp.com/download
  11. 11. How to get started with DooPHPsvn checkout http://doophp.googlecode.com/svn/trunk/ doophp
  12. 12. Read the guide, api doc & blog http://doophp.com/docVisit the forum if you have questions & suggestions
  13. 13. Basic app structure
  14. 14. Basic app structure
  15. 15. With HMVC usage example module
  16. 16. DooPHP MVC Flow
  17. 17. How to start writing my app? 3 ways to write: • The manual way • The automated way • Hybrid
  18. 18. The manual way
  19. 19. Define routes
  20. 20. Create Controller & Action method
  21. 21. View rendering
  22. 22. Output Result
  23. 23. The automated way
  24. 24. What to automate? Auto routing no more defining in routes.conf.php Auto view rendering no need to specify a view to be rendered
  25. 25. Let’s do some tweaksAuto routing1. Remove the routes definition in routes.conf.php2. Set AUTOROUTE to true in common.conf.phpAuto view rendering1. Remove $this->renderc() in controller2. Set $autorender property to true in controller
  26. 26. Remove the routes definition in routes.conf.phpSet AUTOROUTE to true in common.conf.php
  27. 27. StoreController
  28. 28. TaDa! Same output result
  29. 29. What’s the difference?Manual way Gives you whole lot of manual controls, good news for ya’, control freaks! Auto way Save you all da’ tedious wok’! Good news for ya, lazy bump!
  30. 30. Hybrid? When?When you’re using auto routing BUT You want some freaking awesome URLs (for SEO purpose, maybe) You want to redirect some non-existent URLs. You want URLs for your users. http://twitty.com.my/leng And some weirdo situation you would never thought of...
  31. 31. Freaking awesome URL* You won’t be ranked number 1 in Google search that easily though
  32. 32. Redirect some URLs
  33. 33. URLs for your users. http://twitty.com.my/lengDoo this in routes.conf.phpDoo this in UserController
  34. 34. And for some weirdo situation youwould never thought of...
  35. 35. I have a controller
  36. 36. Client tends to mistype the URL‘transactions’ a lot. Now, hewanted to be able to accesspages via ‘transactions’ too *screw him
  37. 37. How to do it?
  38. 38. Easiest solution
  39. 39. Another use case for autoroute_aliasWhen you are using auto routing and want a URL structurewhich is deeper than the typicalhttp://domain/controller/method
  40. 40. Model & Database
  41. 41. Configure db.conf.php
  42. 42. Enable DB in index.php
  43. 43. Database example
  44. 44. Define table relationships (if needed)db.conf.php No naming convention required, works with any of your existing DBs.
  45. 45. Generate Models
  46. 46. Model usage example
  47. 47. Querying
  48. 48. Model usage example (extends DooModel)
  49. 49. Some list of methods in DooModel
  50. 50. What do you need other thanDooPHP ?
  51. 51. You need to get a life.
  52. 52. and Probably a good IDE.
  53. 53. NetBeans
  54. 54. Code hinting for DooPHP
  55. 55. Awesome for quick reference
  56. 56. Less is More. I should stop hereand let the Adventurers explore
  57. 57. Questions? Don’t worry, I won’t eat you http://twitter.com/doophp leng@doophp.com
  58. 58. Just Doo IT!

×