1 / 17

Rapid Web Development  (for libraries!) with Symfony 2

Rapid Web Development  (for libraries!) with Symfony 2. Justin Clark Junior Web Developer Berkman Center. So many questions. What is it? Why use it? How's it designed? What's it do? What else does it do?. What is Symfony 2?. Symfony 2 is a PHP Framework for web development

luann
Download Presentation

Rapid Web Development  (for libraries!) with Symfony 2

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Rapid Web Development (for libraries!) with Symfony 2 Justin Clark Junior Web Developer Berkman Center

  2. So many questions • What is it? • Why use it? • How's it designed? • What's it do? • What else does it do?

  3. What is Symfony 2? • Symfony 2 is a PHP Framework for web development • Symfony 2 is MVC • Symfony 2 is OOP • Symfony 2 is probably a bunch more acronyms • Symfony 2 is not Symfony 1 (>=PHP 5.3) • Symfony 2 is HTTP-centric • Symfony 2 is like bits of Rails and like bits of Java http://symfony.com Released July 28, 2011 after ~2.5 years development

  4. Why Symfony 2? PHP was a given Contenders in the area: • Zend is old and huge and scary. • Yii is new and small and one guy. • CakePHP is old and hacky. • CodeIgniter is small and hacky. Symfony 2 is new hotness. Who uses it?     Dailymotion, Yahoo! Answers, Drupal, phpBB

  5. "New hotness" is a stupid phrase.Really, why Symfony 2? Non-technical: • Very modular (standard distro is 21 standalone modules) • Very flexible (dependency injection, service container) • Targeted at serious apps (stable API) • Backed by a company (software as service - take it or leave it) • Very little magic • Kinda, sorta portable • MIT License • Good docs for beginners • Really good code commenting • Responsive community (response from core dev in 4 minutes) • External security audit • On Github (most forked and most watched in PHP, 13th and 24th overall) 

  6. I want CODE Technical: • Includes good ORM (and ODM, but I haven't used it) • Includes very good templating language (safe and expressive) • Includes good asset manager (auto combining, filtering [closure, pngcrush, etc.]) • Includes very good debugging tools (web debug toolbar, linked exceptions, stack traces) • Includes very good caching (includes reverse-proxy, speaks ESI) • Includes good security tools (basic auth through X.509, ACLs) • Includes very good testing tools (PHPUnit and functional testing) • Includes very good generators (models, views, controllers, forms, tests, bundles) • Includes handy autoloading (namespaces)

  7. Not so awesome things • Learning curve • API Docs are complete but so-so • Few advanced docs • Few advanced best-practices docs • It's still PHP

  8. Architecture Request-Response Model Modularity is big selling point. Three main constructs for modularity: • Bundles • Services • Events

  9. Modularity - Bundles • Apps are composed of "bundles" • Bundles are basically packages • They includes models, views, controllers, and whatever else • Bundles can inherit (child bundles) • Zend libraries can be bundles • Apps can override any part of any bundle • New package manager in the works

  10. Modularity - Services • Bundles can provide services • Services are externally configurable (constructor injection, setter injection, property injection, optional config interface) • Services can require or include other services • Services get registered with the service container • Every controller has access to the service container • It's dependency injection

  11. Modularity - Events • Every controller has access to the event dispatcher • It's a hook system to modify any part of any controller

  12. Handy Bundles • Doctrine2 • Twig • Debugging

  13. Doctrine2

  14. Twig

  15. Debugging • Pretty web toolbar • Lots of info pages • Pretty exception handling http://dev5.berkmancenter.org/app.php

  16. What I didn't talk about • Console Tasks • Session-handling • Form validation • Model constraints • Routing • User Bundle (and symfony2bundles.org) • YML, XML, Annotation options • Emailing • Environments • Logging • i18n • Git integration • etc.

  17. Takeaways • Good for little things, good for big things • Learning curve fairly shallow for little things, steep for big things • Little things can be done really quickly • Big things take more time • It's PHP - but modern, solid, secure PHP

More Related