SlideServe
Menu
Préférences
© SlideServe · v2026

PHP MVC Frameworks and Symfony

stew avatar
18 diapositives · 586 Views · May 30, 2012

PHP MVC Frameworks and Symfony. What is MVC?. Model-View-Controller Separates: M: Data model V: Presentation (UI) C: Business logic Can change any of these three without affecting the others (in theory). Why use an MVC framework?. Avoid “reinventing the wheel” Use proven, tested code

PHP MVC Frameworks and Symfony - slide 1
01 / 18PHP MVC Frameworks and Symfony
1 / 17

Télécharger la présentation

PHP MVC Frameworks and Symfony
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. PHP MVC Frameworksand Symfony

  2. What is MVC? • Model-View-Controller • Separates: • M: Data model • V: Presentation (UI) • C: Business logic • Can change any of these three without affecting the others (in theory)

  3. Why use an MVC framework? • Avoid “reinventing the wheel” • Use proven, tested code • Automation (ORM, generators) • Maintainability • “Plugin” functionality

  4. Flow: Traditional vs. MVC Query Controller Model Processing Output Output Query Output Processing View Final Output

  5. Popular PHP MVC Frameworks • CakePHP • Documentation is somewhat lacking • Apparently difficult for beginners • Symfony • Great documentation and community • Easy to get started • Zend • Supported by Zend (official PHP company) • More of a library than complete framework

  6. Why did we choose Symfony? • Steep learning curve, but… • Great documentation • Great community • Well-written and tested code • Nice deployment system (PEAR / SVN) • Extensive use of existing projects, instead of rewriting everything from scratch

  7. http://www.symfony-project.org

  8. Model View Controller

  9. Command line interface • Has a command line interface • Creates the basis for the module • Helps with maintenance • Easy to check if everything worked

  10. Object Relational Mapper (ORM) YAML (Used in RoR) • Propel gives database independence • Id, created_at, & foreign key fields are autogenerated

  11. Object Relational Mapper (ORM) • Database tables = classes & table rows = objects • Auto-generated based on schema

  12. Admin Generator • List, show, edit, & add • 4 pages, < 30 LOC

  13. i18n and l10n English: (LTR) Arabic: (RTL)

  14. Symfony Plugins • 100s of plugins • Easy integration • AJAX, CSS, CMS, SEO, Security, Flash, etc.

  15. Diagnose Problems • Check Execution Time • Optimize SQL Queries

  16. Should you use an MVC framework for your next project? • Are there complex hierarchical relationships in your data? • Will this project need to be maintained by more than one person for more than a year? • Do you need the ability to add advanced features like AJAX without writing the code from scratch? • Probably Yes. (unless it’s a throwaway)

  17. Which MVC Framework? • .NET (official) • Ruby on Rails • PHP • CakePHP • Symfony • Zend • Use a well-established framework with good documentation and a large community

  18. More information • Symfony Project: • http://www.symfony-project.org • Syllogistic Software: • http://www.syllogisticsoftware.com • Questions? • Contact Jason Hanley – jhanley@sylsft.com