Have you been reviewing all Zend Framework has to offer but aren't sure how to integrate it with your existing code? How can you begin taking advantage of Zend Framework without having to fully adopt the MVC architecture? What do you do when you later want to being using MVC? Hint: You don't have to throw away any of your code! This session will present ideas and examples on how you can integrate Zend Framework alongside your existing code base with minimal need for future re-factoring.
2. About Me
Zend Certified Engineer
Coding PHP since 1999 (PHP 3)
Using Zend Framework since 2008 (ver. 1.0.4)
All-around cool guy
3. About Me
Zend Certified Engineer
Coding PHP since 1999 (PHP 3)
Using Zend Framework since 2008 (ver. 1.0.4)
All-around cool guy
image source: http://i78.photobucket.com/albums/j86/Goku1983d/cover-fonz.jpg
6. About This Presentation
Slides, code examples and video recording at
notmessenger.com/presentations
Provide feedback via Joind.in at
http://joind.in/talk/view/1782
8. About You
How many of you have played with
or used Zend Framework before?
9. About You
How many of you have played with
or used Zend Framework before?
How many of you have heard of Zend
Framework before?
10. About You
How many of you have played with
or used Zend Framework before?
How many of you have heard of Zend
Framework before?
How many of you realize you’re in the wrong
session?
image source: http://www.mind-body-science.com/images/frantic.jpg
16. Recap
Can easily use a Zend_? module as needed
Simply add Zend Framework to include path
Zend_Loader_Autoloader does all the work
for you
17. Recap
Can easily use a Zend_? module as needed
Simply add Zend Framework to include path
Zend_Loader_Autoloader does all the work
for you
image source: http://www.quantum360.co.uk/Portals/0/images/easy%20image.jpg
18. Add new functionality
to existing codebase
image source: http://aimeegd.files.wordpress.com/2009/04/bricks2.jpg
24. Recap
Can continue to use own autoloader.
Zend Framework’s autoloader can also be
used.
Result? Can easily add new functionality
implementing Zend Framework code into
existing codebase.
25. Recap
Can continue to use own autoloader.
Zend Framework’s autoloader can also be
used.
Result? Can easily add new functionality
implementing Zend Framework code into
existing codebase.
image source: http://www.quantum360.co.uk/Portals/0/images/easy%20image.jpg
27. Separation of concerns
Previous examples had none or very little
Model, View, Controller (MVC)
Models == data and/or business logic
In Zend Framework, Models are implemented
as objects
30. Recap
Write all new functionality as objects - you
will need them in Zend Framework
A large part of the “M” in “MVC” (Model)
already coded - less work later
Easy to later separate the “VC” parts of
“MVC” (View-Controller)
31. Recap
Write all new functionality as objects - you
will need them in Zend Framework
A large part of the “M” in “MVC” (Model)
already coded - less work later
Easy to later separate the “VC” parts of
“MVC” (View-Controller)
image source: http://www.quantum360.co.uk/Portals/0/images/easy%20image.jpg
33. Migrate existing site
image source: http://farm1.static.flickr.com/100/308786610_f147876c71_o.jpg
34. Never stop developing
Apache mod_rewrite rules (and IIS
equivalents)
All requests get routed to/through the
Front Controller
Leverage this to convert specific pages or
sections at a time
37. Recap
Rewrite rules make it very easy to convert
existing sites to Zend Framework
Existing pages or sections can be migrated at
own pace
Old and new code can be maintained
simultaneously
38. Recap
Rewrite rules make it very easy to convert
existing sites to Zend Framework
Existing pages or sections can be migrated at
own pace
Old and new code can be maintained
simultaneously
Now that was easy!
image source: http://www.quantum360.co.uk/Portals/0/images/easy%20image.jpg
39. Thank you
Slides, code examples and video recording at
notmessenger.com/presentations
Provide feedback via Joind.in at
http://joind.in/talk/view/1782