bally chohan : zend framework quick tutor
Post on 12-Sep-2014
322 views
DESCRIPTION
Bally Chohan IT Solution is an UK based IT agency. A Little & Basic overview about "zend Framework" is elaborated here.TRANSCRIPT
Zend Framework Zend Framework Quick startQuick start
Bally chohanIT Solution
Zend Framework quick start Zend Framework quick start by Bally chohan IT Solutionby Bally chohan IT Solution
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
Design with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally chohanDesign with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally chohan
Design patterns by Bally Design patterns by Bally ChohanChohan
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/Design_pattern_(computer_science)wiki/Design_pattern_(computer_science)
Design with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally Design with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally chohanchohan
MVC design patterns by Bally MVC design patterns by Bally Chohan IT SolutionChohan IT Solution
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.
Design with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally chohanDesign with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally chohan
Directory structure by Bally Directory structure by Bally chohan IT Solutionchohan IT Solution
Bootstrap (index.php) by Bootstrap (index.php) by Bally Chohan IT SolutionBally Chohan IT Solution
Hello world with ZF MVC – by Hello world with ZF MVC – by Bally Chohan Bally ChohanBally Chohan Bally Chohan
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.phpapplication/controllers/IndexController.php<?<?
class IndexController extends Zend_Ctontroller_Actionclass IndexController extends Zend_Ctontroller_Action{{
public function indexAction()public function indexAction(){{}}
}}?>?>Design with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally chohanDesign with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally chohan
Hello world cont… by Bally Hello world cont… by Bally chohan IT Solutionchohan IT Solution
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>
Using Models – Bally chohanUsing Models – Bally chohan
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;}}
} } ?>?>
Model cont.. By Bally ChohanModel cont.. By Bally Chohan
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;
}}}}
?>?>
Design with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally Design with Bally Chohan – Develop with Bally Chohan – Code with Bally chohan – Test with Bally Chohan – UAT with Bally chohanchohan
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;
?>?>
ThanksThanks
Next…..Next…..
Two step viewTwo step view
Zend_Db_ConfigurationZend_Db_Configuration
And many more…..And many more…..
Bally Chohan IT Bally Chohan IT SolutionSolution
http://www.ballychohan.com