SlideShare uma empresa Scribd logo
1 de 28
PHP Frameworks Using PHP framework for development process
“ A software framework, in computer programming, is an abstraction in which  common code providing generic functionality  can be selectively overridden or specialized by user code providing specific functionality. Frameworks are a special case of software libraries in that they are  reusable abstractions of code  wrapped in a well-defined Application programming interface (API), yet they contain some key distinguishing features that separate them from normal libraries. ”
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Enterprise Softwares
 
[object Object],[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object]
 
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Front  Controller Action Controller Component Library Data Internationalization PDF Database JSON Date Translate Locale Webservices SOAP Amazon Google Core Log Cache ACL Plugins View Edit Del HTTP Request
[object Object],[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
<?php /** * Index Controller */ class  IndexController  extends  Zend_Controller_Action { /** * Index Action */ public function  indexAction() { // action body } }
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
<?php $params  = array( ' host ' => ' 127.0.0.1 ', ' username ' => ' webuser ', ' password ' => ’ ******* ', ' dbname ' => ' test ', ); $db  =  Zend_Db::factory (' Pdo_Mysql ',  $params ); $sql  = ‘ SELECT * FROM users ’; $rows  =  $db ->fetchAll( $sql );
<?php $select = $db -> select ()                   -> from (‘ users ’,  array (‘username’, ‘email’))                        -> where (‘ username = ? ’,  $username ) ; //Same as: // SELECT username, email FROM users // WHERE username = ‘…’ $user  =  $db -> fetchRow ( $select );
<?php class  Users  extends  Zend_Db_Table_Abstract { protected  $_name  = ' users '; protected  $_primaryKey  = ' user_id '; } //Insert $user  =  new  Users (); $user -> insert ( array ( ‘ username ’ => ‘ cusc ’ ‘ name ’ => ‘ CUSC Software ’, ‘ email ’ => ‘ [email_address] ’ ));
<?php //Update $user  =  new  Users (); $data  =  array ( ‘ email ’ => ‘ [email_address] ’ ); $user -> update ( $data , ‘ user_id = 1234 ’); //Delete row $user -> delete (‘ user_id = 1234 ’);
<?php //Find rows by primary key $user  =  new  Users (); $rows  =  $user -> find (1234); //Find by conditions $select  =  $user -> select ()                           -> where (“ email LIKE ‘%?’ ”, ‘musical .vn ’); $rows  =  $user -> fetchAll ( $select );
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
<?php /** * Index Controller */ class  IndexController  extends  Zend_Controller_Action { /** * Index Action */ public function  indexAction() { $this -> view -> name  = ‘ Dream Team ’; } }
<?php //index.phtml < h1 ><?php  echo  $this -> escape ( $this -> name ); ?></ h1 >
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
class  Admin_Form_Account  extends  Zend_Form { public function  init()  { parent :: init (); $this -> setAction (' /admin/account/createPost '); $this -> addElement ( $this -> createElement (' text ', ' username ',  array ( ' required ' => true, ' label '       => ' Username ', ))); $this -> addElement ( $this -> createElement (' text ', ' name ',  array (            ' required ' => true,            ' label '       => ' Name ', ))); $this -> addElement ( $this -> createElement (' text ', ' email ',  array (            ' required ' => true,            ' label ' => ' Email ', ))); $this -> addElement ( $this -> createElement (' password ', ' password ',  array (            ' required ' => true,            ' label ' => ' Lastname ', ))); $this -> addElement (' submit ', ' Submit '); } }
<?php class  Admin_Account_Controller  extends  Zend_Controller_Action { public function  formAction() {            $form  = new  Admin_Form_Account ();            $this -> view -> form  =  $form ; } public function  createPostAction() {            $form  = new  Admin_Form_Account ();            if  (! $form -> isValid ( $this -> getRequest ()-> getPost ())) {                     $this -> view -> form  =  $form ;                     $this -> render (’ form ');            }  else  {                     $this -> _forward (’ success ');            } } }
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
class  Admin_Form_Account  extends  Zend_Form { public function  init()  {         parent :: init ();         $this -> addElement ( $this -> createElement (' text ', ' email ',  array (                 ' required '   => true,                 ' label '         => ' Email ',                 ' validators ' =>  array (' emailaddress '),           ))); } }
[object Object],[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object]

Mais conteúdo relacionado

Mais procurados

P H P Part I I, By Kian
P H P  Part  I I,  By  KianP H P  Part  I I,  By  Kian
P H P Part I I, By Kian
phelios
 
Php Security3895
Php Security3895Php Security3895
Php Security3895
Aung Khant
 

Mais procurados (20)

Creating fast, dynamic ACLs in Zend Framework
Creating fast, dynamic ACLs in Zend FrameworkCreating fast, dynamic ACLs in Zend Framework
Creating fast, dynamic ACLs in Zend Framework
 
Why is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenariosWhy is crud a bad idea - focus on real scenarios
Why is crud a bad idea - focus on real scenarios
 
What's New in ZF 1.10
What's New in ZF 1.10What's New in ZF 1.10
What's New in ZF 1.10
 
Zend Framework
Zend FrameworkZend Framework
Zend Framework
 
P H P Part I I, By Kian
P H P  Part  I I,  By  KianP H P  Part  I I,  By  Kian
P H P Part I I, By Kian
 
Crafting [Better] API Clients
Crafting [Better] API ClientsCrafting [Better] API Clients
Crafting [Better] API Clients
 
Php Security3895
Php Security3895Php Security3895
Php Security3895
 
Using Geeklog as a Web Application Framework
Using Geeklog as a Web Application FrameworkUsing Geeklog as a Web Application Framework
Using Geeklog as a Web Application Framework
 
Refactoring using Codeception
Refactoring using CodeceptionRefactoring using Codeception
Refactoring using Codeception
 
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
SADI in Perl - Protege Plugin Tutorial (fixed Aug 24, 2011)
 
Concern of Web Application Security
Concern of Web Application SecurityConcern of Web Application Security
Concern of Web Application Security
 
PHP security audits
PHP security auditsPHP security audits
PHP security audits
 
Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101Geek Moot '09 -- Smarty 101
Geek Moot '09 -- Smarty 101
 
Django Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, TricksDjango Forms: Best Practices, Tips, Tricks
Django Forms: Best Practices, Tips, Tricks
 
Unit testing zend framework apps
Unit testing zend framework appsUnit testing zend framework apps
Unit testing zend framework apps
 
Into to DBI with DBD::Oracle
Into to DBI with DBD::OracleInto to DBI with DBD::Oracle
Into to DBI with DBD::Oracle
 
Meet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for PerformanceMeet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
Meet Magento Sweden - Magento 2 Layout and Code Compilation for Performance
 
PHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4DevelopersPHPSpec - the only Design Tool you need - 4Developers
PHPSpec - the only Design Tool you need - 4Developers
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client Developers
 
Zend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_ToolZend Framework 1.9 Setup & Using Zend_Tool
Zend Framework 1.9 Setup & Using Zend_Tool
 

Semelhante a Framework

Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
Peter Wilcsinszky
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
funkatron
 
Cakefest 2010: API Development
Cakefest 2010: API DevelopmentCakefest 2010: API Development
Cakefest 2010: API Development
Andrew Curioso
 
12-security.ppt - PHP and Arabic Language - Index
12-security.ppt - PHP and Arabic Language - Index12-security.ppt - PHP and Arabic Language - Index
12-security.ppt - PHP and Arabic Language - Index
webhostingguy
 

Semelhante a Framework (20)

Php frameworks
Php frameworksPhp frameworks
Php frameworks
 
Testing persistence in PHP with DbUnit
Testing persistence in PHP with DbUnitTesting persistence in PHP with DbUnit
Testing persistence in PHP with DbUnit
 
Intro To Mvc Development In Php
Intro To Mvc Development In PhpIntro To Mvc Development In Php
Intro To Mvc Development In Php
 
Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2Zend Framework Study@Tokyo #2
Zend Framework Study@Tokyo #2
 
Bag Of Tricks From Iusethis
Bag Of Tricks From IusethisBag Of Tricks From Iusethis
Bag Of Tricks From Iusethis
 
PHP POWERPOINT SLIDES
PHP POWERPOINT SLIDESPHP POWERPOINT SLIDES
PHP POWERPOINT SLIDES
 
Boston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on RailsBoston Computing Review - Ruby on Rails
Boston Computing Review - Ruby on Rails
 
Cakefest 2010: API Development
Cakefest 2010: API DevelopmentCakefest 2010: API Development
Cakefest 2010: API Development
 
Moodle Quick Forms
Moodle Quick FormsMoodle Quick Forms
Moodle Quick Forms
 
Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5Bootstrat REST APIs with Laravel 5
Bootstrat REST APIs with Laravel 5
 
Exploring Symfony's Code
Exploring Symfony's CodeExploring Symfony's Code
Exploring Symfony's Code
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
Zend framework service
Zend framework serviceZend framework service
Zend framework service
 
PHP
PHP PHP
PHP
 
Modern Web Development with Perl
Modern Web Development with PerlModern Web Development with Perl
Modern Web Development with Perl
 
WordPress as a Content Management System
WordPress as a Content Management SystemWordPress as a Content Management System
WordPress as a Content Management System
 
Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8Unit testing after Zend Framework 1.8
Unit testing after Zend Framework 1.8
 
Magento Indexes
Magento IndexesMagento Indexes
Magento Indexes
 
12-security.ppt - PHP and Arabic Language - Index
12-security.ppt - PHP and Arabic Language - Index12-security.ppt - PHP and Arabic Language - Index
12-security.ppt - PHP and Arabic Language - Index
 
Security.ppt
Security.pptSecurity.ppt
Security.ppt
 

Último

Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
Earley Information Science
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 

Framework

  • 1. PHP Frameworks Using PHP framework for development process
  • 2. “ A software framework, in computer programming, is an abstraction in which  common code providing generic functionality  can be selectively overridden or specialized by user code providing specific functionality. Frameworks are a special case of software libraries in that they are  reusable abstractions of code  wrapped in a well-defined Application programming interface (API), yet they contain some key distinguishing features that separate them from normal libraries. ”
  • 3.
  • 4.  
  • 5.
  • 6.
  • 7.  
  • 8.
  • 9. Front Controller Action Controller Component Library Data Internationalization PDF Database JSON Date Translate Locale Webservices SOAP Amazon Google Core Log Cache ACL Plugins View Edit Del HTTP Request
  • 10.
  • 11.
  • 12. <?php /** * Index Controller */ class IndexController extends Zend_Controller_Action { /** * Index Action */ public function indexAction() { // action body } }
  • 13.
  • 14. <?php $params = array( ' host ' => ' 127.0.0.1 ', ' username ' => ' webuser ', ' password ' => ’ ******* ', ' dbname ' => ' test ', ); $db = Zend_Db::factory (' Pdo_Mysql ', $params ); $sql = ‘ SELECT * FROM users ’; $rows = $db ->fetchAll( $sql );
  • 15. <?php $select = $db -> select ()                   -> from (‘ users ’,  array (‘username’, ‘email’))                       -> where (‘ username = ? ’, $username ) ; //Same as: // SELECT username, email FROM users // WHERE username = ‘…’ $user = $db -> fetchRow ( $select );
  • 16. <?php class Users extends Zend_Db_Table_Abstract { protected $_name = ' users '; protected $_primaryKey = ' user_id '; } //Insert $user = new Users (); $user -> insert ( array ( ‘ username ’ => ‘ cusc ’ ‘ name ’ => ‘ CUSC Software ’, ‘ email ’ => ‘ [email_address] ’ ));
  • 17. <?php //Update $user = new Users (); $data = array ( ‘ email ’ => ‘ [email_address] ’ ); $user -> update ( $data , ‘ user_id = 1234 ’); //Delete row $user -> delete (‘ user_id = 1234 ’);
  • 18. <?php //Find rows by primary key $user = new Users (); $rows = $user -> find (1234); //Find by conditions $select = $user -> select ()                           -> where (“ email LIKE ‘%?’ ”, ‘musical .vn ’); $rows = $user -> fetchAll ( $select );
  • 19.
  • 20. <?php /** * Index Controller */ class IndexController extends Zend_Controller_Action { /** * Index Action */ public function indexAction() { $this -> view -> name = ‘ Dream Team ’; } }
  • 21. <?php //index.phtml < h1 ><?php echo $this -> escape ( $this -> name ); ?></ h1 >
  • 22.
  • 23. class Admin_Form_Account extends Zend_Form { public function init()  { parent :: init (); $this -> setAction (' /admin/account/createPost '); $this -> addElement ( $this -> createElement (' text ', ' username ', array ( ' required ' => true, ' label '       => ' Username ', ))); $this -> addElement ( $this -> createElement (' text ', ' name ', array (           ' required ' => true,           ' label '       => ' Name ', ))); $this -> addElement ( $this -> createElement (' text ', ' email ', array (           ' required ' => true,           ' label ' => ' Email ', ))); $this -> addElement ( $this -> createElement (' password ', ' password ', array (           ' required ' => true,           ' label ' => ' Lastname ', ))); $this -> addElement (' submit ', ' Submit '); } }
  • 24. <?php class Admin_Account_Controller extends Zend_Controller_Action { public function formAction() {           $form = new Admin_Form_Account ();           $this -> view -> form = $form ; } public function createPostAction() {           $form = new Admin_Form_Account ();           if (! $form -> isValid ( $this -> getRequest ()-> getPost ())) {                     $this -> view -> form = $form ;                     $this -> render (’ form ');           } else {                     $this -> _forward (’ success ');           } } }
  • 25.
  • 26. class Admin_Form_Account extends Zend_Form { public function init()  {         parent :: init ();         $this -> addElement ( $this -> createElement (' text ', ' email ', array (                 ' required '   => true,                 ' label '         => ' Email ',                 ' validators ' => array (' emailaddress '),           ))); } }
  • 27.
  • 28.