![Page 1: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/1.jpg)
Zend Framework Zend Framework Quick startQuick start
Faheem Abbas Faheem Abbas
Software engineerSoftware engineer
![Page 2: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/2.jpg)
Zend Framework quick startZend Framework quick start
1.1. Design patternsDesign patterns
2.2. MVC design patternsMVC design patterns
3.3. Directory StructureDirectory Structure
4.4. BootstrapBootstrap
5.5. Hello world exampleHello world example
![Page 3: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/3.jpg)
Design patternsDesign patterns
a a design patterndesign pattern is a general reusable is a general reusable solution to a commonly occurring solution to a commonly occurring problem in software design.problem in software design.
((en.wikipedia.org/en.wikipedia.org/wiki/wiki/Design_pattern_(computer_science)Design_pattern_(computer_science)))
![Page 4: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/4.jpg)
MVC design patternsMVC design patterns
Model-View-Controller (MVC) is a designpattern that simplifies applicationdevelopment and maintenance.1. Model: Responsible for the business logic
of an application2. View: Typically what would be considered
web design, or templating.3. Controller: The controller layer glues
everything together.
![Page 5: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/5.jpg)
Directory structureDirectory structure
![Page 6: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/6.jpg)
Bootstrap (index.php)Bootstrap (index.php)
![Page 7: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/7.jpg)
Hello world with ZF MVCHello world with ZF MVC
We have done basic configuration.We have done basic configuration.It time to have fun….It time to have fun….In your In your
application/controllers/IndexController.phapplication/controllers/IndexController.phpp
<?<?class IndexController extends Zend_Ctontroller_Actionclass IndexController extends Zend_Ctontroller_Action{{
public function indexAction()public function indexAction(){{}}
}}?>?>
![Page 8: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/8.jpg)
Hello world cont…Hello world cont…
Next in your application/views/Next in your application/views/Create views/index/index.phtmlCreate views/index/index.phtmlAnd writeAnd write<html><html><body><body>Hello world…………..Hello world…………..</body></body></html></html>
![Page 9: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/9.jpg)
Using ModelsUsing Models
In application/modelsIn application/modelsWriteWrite<?<?class Mathclass Math{{
public function __construct()public function __construct(){{}}public function sum($val1,$val2)public function sum($val1,$val2){{
return $val1 + $val2;return $val1 + $val2;}}
} } ?>?>
![Page 10: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/10.jpg)
Model cont..Model cont..
Now in controller, writeNow in controller, write<?<?
class IndexController extends Zend_Ctontroller Actionclass IndexController extends Zend_Ctontroller Action{{
public function indexAction()public function indexAction(){{
$math = new Math();$math = new Math();$sum = $math->sum(5,10);$sum = $math->sum(5,10);$this->view->sum=$sum;$this->view->sum=$sum;
}}}}
?>?>
![Page 11: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/11.jpg)
Example cont…Example cont…
And finally in your And finally in your view(application/view/scripts/index/indview(application/view/scripts/index/index.phtml)ex.phtml)
Write,Write,
<?<?
echo ‘sum is ’ . $this->sum;echo ‘sum is ’ . $this->sum;
?>?>
![Page 12: Zend Framework Quick start Faheem Abbas Software engineer](https://reader036.vdocuments.site/reader036/viewer/2022083008/56649eac5503460f94bb1dd4/html5/thumbnails/12.jpg)
ThanksThanks
Next…..Next…..
Two step viewTwo step view
Zend_Db_ConfigurationZend_Db_Configuration
And many more…..And many more…..
Faheem AbbasFaheem Abbas
Software Software engineerengineer