KEMBAR78
MVC with Zend Framework | PDF
MVC
  with




Mario Volke
What is                ?

 • Popular PHP Framework
   • Component Library
   • Application Framework
 • Open-source (New BSD License)
 • High unit-test coverage
 • Main goals
   •   Flexibility
   •   Extensibility
   •   Simplicity
   •   Productivity
Patterns related to MVC
  • Zend_M...?
     • Models can be very different: DB, WebService,
     Feeds,...
     • But:
         • Zend_Db (Adapter pattern)
         • Zend_Service
         • Zend_Feed
         • etc.
  • Zend_Crontroller
     • Front Controller pattern
     • Zend_Controller_Action
          •action methods correspond to the various actions
          you wish the controller to handle
  • Zend_View
     • template system agnostic
     • Zend_Layout implements Two Step View pattern
Structure
Behaviour
Sample Code
index.php
  require_once 'Zend/Application.php';
  // Create application, bootstrap, and run
  $application = new Zend_Application();
  $application->bootstrap()->run();



HelloController.php
  class HelloController extends Zend_Controller_Action {
     public function worldAction() { }
  }



world.php
  <html>
  <head><title>Hello World!</title></head>
  <body>
    <h1>Hello World!</h1>
  </body>
  </html>                         -> http://example.com/hello/world
Further info
Introduction
   • http://framework.zend.com/docs/quickstart
Reference
   • http://framework.zend.com/manual/en/
Webinars
   • http://www.zend.com/en/resources/webinars/framework




                        </talk>

MVC with Zend Framework

  • 1.
  • 2.
    What is ? • Popular PHP Framework • Component Library • Application Framework • Open-source (New BSD License) • High unit-test coverage • Main goals • Flexibility • Extensibility • Simplicity • Productivity
  • 3.
    Patterns related toMVC • Zend_M...? • Models can be very different: DB, WebService, Feeds,... • But: • Zend_Db (Adapter pattern) • Zend_Service • Zend_Feed • etc. • Zend_Crontroller • Front Controller pattern • Zend_Controller_Action •action methods correspond to the various actions you wish the controller to handle • Zend_View • template system agnostic • Zend_Layout implements Two Step View pattern
  • 4.
  • 5.
  • 6.
    Sample Code index.php require_once 'Zend/Application.php'; // Create application, bootstrap, and run $application = new Zend_Application(); $application->bootstrap()->run(); HelloController.php class HelloController extends Zend_Controller_Action { public function worldAction() { } } world.php <html> <head><title>Hello World!</title></head> <body> <h1>Hello World!</h1> </body> </html> -> http://example.com/hello/world
  • 7.
    Further info Introduction • http://framework.zend.com/docs/quickstart Reference • http://framework.zend.com/manual/en/ Webinars • http://www.zend.com/en/resources/webinars/framework </talk>