Zend Framework Quick start - PowerPoint PPT Presentation

About This Presentation
Title:

Zend Framework Quick start

Description:

Zend Framework Quick start Faheem Abbas Software engineer Zend Framework quick start Design patterns MVC design patterns Directory Structure Bootstrap Hello world ... – PowerPoint PPT presentation

Number of Views:363
Avg rating:3.0/5.0
Slides: 13
Provided by: shaz151
Category:
Tags: framework | quick | start | zend

less

Transcript and Presenter's Notes

Title: Zend Framework Quick start


1
Zend Framework Quick start
  • Faheem Abbas
  • Software engineer

2
Zend Framework quick start
  1. Design patterns
  2. MVC design patterns
  3. Directory Structure
  4. Bootstrap
  5. Hello world example

3
Design patterns
  •  a design pattern is a general reusable solution
    to a commonly occurring problem in software
    design.
  • (en.wikipedia.org/wiki/Design_pattern_(comput
    er_science))

4
MVC design patterns
  • Model-View-Controller (MVC) is a design
  • pattern that simplifies application
  • development and maintenance.
  • Model Responsible for the business logic of an
    application
  • View Typically what would be considered web
    design, or templating.
  • Controller The controller layer glues everything
    together.

5
Directory structure
6
Bootstrap (index.php)
7
Hello world with ZF MVC
  • We have done basic configuration.
  • It time to have fun.
  • In your application/controllers/IndexController.ph
    p
  • lt?
  • class IndexController extends Zend_Ctontroller_Ac
    tion
  • public function indexAction()
  • ?gt

8
Hello world cont
  • Next in your application/views/
  • Create views/index/index.phtml
  • And write
  • lthtmlgt
  • ltbodygt
  • Hello world..
  • lt/bodygt
  • lt/htmlgt

9
Using Models
  • In application/models
  • Write
  • lt?
  • class Math
  • public function __construct()
  • public function sum(val1,val2)
  • return val1 val2
  • ?gt

10
Model cont..
  • Now in controller, write
  • lt?
  • class IndexController extends Zend_Ctontroller
    Action
  • public function indexAction()
  • math new Math()
  • sum math-gtsum(5,10)
  • this-gtview-gtsumsum
  • ?gt

11
Example cont
  • And finally in your view(application/view/scripts/
    index/index.phtml)
  • Write,
  • lt?
  • echo sum is . this-gtsum
  • ?gt

12
Thanks
  • Next..
  • Two step view
  • Zend_Db_Configuration
  • And many more..
  • Faheem Abbas
  • Software engineer
Write a Comment
User Comments (0)
About PowerShow.com