2. • What is Zend Framework?
• Getting and Installing Zend
Framework
• MVC overview
• Quick Start to developing
applications using Zend
Framework's
3. What is Zend Framework?
• PHP 5 library for web development
productivity
• Free, Open source
• Class library – fully OOP
• Documentation – in many languages
• Quality & testing – fully unit tested
13. Locate the zfModel in the Controller
Using the utility
In bin/zf.sh of bin/zf.bat of your ZF install
(choose based on your OS)
Place bin/ in your path, or create an alias on
your path:
alias zf=/path/to/bin/zf.sh
20. Create a controller
All controllers extend
Zend_Controller_Action
Naming conventions
Controllers end with 'Controller':
IndexController, GuestbookController
Action methods end with 'Action':
signAction(), displayAction(), listAction()
Controllers should be in the
application/controllers/ directory, and named
after the class, with a “.php” suffix:
application/controllers/IndexController.php
27. Create a view
Create a view script
• View scripts go in application/views/scripts/
• View script resolution looks for a view script
in a subdirectory named after the controller
– Controller name used is same as it appears on the
url:
• “GuestbookController” appears on the URL as
“guestbook”
• View script name is the action name as it
appears on the url:
• “signAction()” appears on the URL as “sign”
30. Create a Form
Zend_Form:
• Flexible form generations
• Element validation and filtering
• Rendering
View helper to render element
Decorators for labels and HTML wrappers
• Optional Zend_Config configuraion
31. Create a form – Identify elements
Guestbook form:
• Email address
• Comment
• Captcha to reduce spam entries
• Submit button
33. Using the Form in the Controller
• Controller needs to fetch form object
• On landing page, display the form
• On POST requests, attempt to validate the
form
• On successful submission, redirect