Introduction to symfony2

  • 9,688 views
Uploaded on

 

More in: Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
9,688
On Slideshare
0
From Embeds
0
Number of Embeds
4

Actions

Shares
Downloads
165
Comments
0
Likes
9

Embeds 0

No embeds

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
    No notes for slide

Transcript

  • 1. Introduction to by Pablo Godel Jan 11 2012 - South Florida PHP Users GroupWednesday, January 11, 2012
  • 2. Who Am I?⁃ Born in Argentina, living in the US since 1999⁃ PHP & Symfony developer⁃ Founder of the PHP mailing list in spanish⁃ Cofounder of ServerGrove Networks ⁃ Founded in 2005 ⁃ provider of web hosting specialized in PHP, Symfony, ZendFramework among others ⁃ Very active open source supporter through code contributions and usergroups/conference sponsoringWednesday, January 11, 2012
  • 3. Wednesday, January 11, 2012
  • 4. History of SymfonyWednesday, January 11, 2012
  • 5. Releases - symfony 1.0: January 2007 - symfony 1.2: November 2008 - symfony 1.4: November 2009 - Symfony 2.0: July 2011 - Symfony 2.1: Planned for early 2012Wednesday, January 11, 2012
  • 6. symfony 1.0 released on January 2007 “symfony is a full-stack framework, a library of cohesive classes written in PHP” - Several libraries put together (modified Mojavi, Propel, Prado i18n, etc) - Concepts borrowed from several languages and frameworks - Routing, CLI, functional tests,YAML, helpers - One of first PHP frameworks to include a Web Debug Toolbar, and an Admin Generator.Wednesday, January 11, 2012
  • 7. symfony 1.0 Highlights - ORM integration: Propel and Doctrine - YAML cascading configuration - Web Debug Toolbar - Admin Generator - Environments - CLI - Functional Tests - Template Caching - Internationalization - Documentation - Plugins - Awesome CommunityWednesday, January 11, 2012
  • 8. symfony 1.0 Highlights - Web Debug ToolbarWednesday, January 11, 2012
  • 9. symfony 1.0 Highlights - Admin GeneratorWednesday, January 11, 2012
  • 10. symfony 1.0 Highlights - Command Line InterfaceWednesday, January 11, 2012
  • 11. symfony 1.0 Highlights - Documentation - A Gentle Introduction to symfony - Practical symfony (jobeet tutorial) - The symfony Reference Book - More with symfony - The API documentation http://www.symfony-project.org/doc/1_4/Wednesday, January 11, 2012
  • 12. symfony 1.0 Highlights - Awesome CommunityIRC #symfony & #symfony-devsGoogle Groups symfony-users http://groups.google.com/group/symfony-users symfony-devs http://groups.google.com/group/symfony-devs symfony-es http://groups.google.com/group/symfony-esWiki http://trac.symfony-project.org/wiki/Forums http://forum.symfony-project.org/Lots of BlogsConferences around the world: US, France, Germany,SpainWednesday, January 11, 2012
  • 13. symfony 1.0 Highlights - PluginsWednesday, January 11, 2012
  • 14. symfony 1 vs. Symfony 2 Same philosophy Rewritten from scratchWednesday, January 11, 2012
  • 15. symfony 1 vs. Symfony 2 symfony 1 != Symfony2Wednesday, January 11, 2012
  • 16. symfony 1 vs. Symfony 2 If you used symfony 1.x better forget about it.Wednesday, January 11, 2012
  • 17. Symfony 2 “First, Symfony2 is a reusable set of standalone, decoupled, and cohesive PHP components that solve common web development problems. Then, based on these components, Symfony2 is also a full-stack web framework.” http://fabien.potencier.org/article/49/what-is-symfony2Wednesday, January 11, 2012
  • 18. Symfony 2 21 High Quality ComponentsWednesday, January 11, 2012
  • 19. Symfony 2 Components • DependencyInjection • Serializer • EventDispatcher • Validator • HttpFoundation • Security • DomCrawler • Routing • ClassLoader • Console • CssSelector • Process • HttpKernel • Config • BrowserKit • Finder • Templating • Locale • Translation • Yaml • Serializer • Form All of them at GitHub: http://github.com/symfonyWednesday, January 11, 2012
  • 20. Symfony 2 Components Components Documentation http://symfony.com/doc/current/components/index.html Blog post series about creating a framework based on the Symfony2 Components http://fabien.potencier.org/Wednesday, January 11, 2012
  • 21. Symfony 2 Highlights • Rewritten from scratch for PHP 5.3 • Based on the HTTP specification • Very stable and solid API (12 preview releases, 5 beta releases, 6 release candidates, 9 stable releases) • Extensible through the creation of Bundles (replacement for sf1 plugins) • Flexible configuration using YAML, XML, annotations or PHP • All configuration is compiled to PHP code and cached • Lots of unit tests • Source code audited by independent security firm thanks to donations of the Symfony CommunityWednesday, January 11, 2012
  • 22. Symfony 2 Highlights • Extensible Configuration with Service Container/ Dependency Injection • Complete redesign of Forms support • Validations • Extensible Security with Authentication/Authorization • Advanced and powerful templating through Twig • Routes configured with YAML, XML or Annotations • ESI Caching support out of the box • Assets management with Assetic • Translations • EnvironmentsWednesday, January 11, 2012
  • 23. Symfony 2 Community • 357 developers contributed to Symfony2 • 3000+ pull requests • 969 977 bundles at knpbundles.com • Same very active IRC and mailing lists support channels • Community Gamification through SensioLabs Connect • Symfony2 EcosystemWednesday, January 11, 2012
  • 24. Symfony 2 Highlights - SensioLabs ConnectWednesday, January 11, 2012
  • 25. Symfony 2 Highlights - BundlesWednesday, January 11, 2012
  • 26. Symfony 2 Getting Startedhttp://symfony.com/downloadWednesday, January 11, 2012
  • 27. Symfony 2 Getting Started tar zxf Symfony_Standard_Vendors_2.0.9.tgz or unzip Symfony_Standard_Vendors_2.0.9.zipWednesday, January 11, 2012
  • 28. Symfony 2 Getting Started Distributions A Symfony distribution is made up of Symfony2 components, a selection of bundles, a directory structure, a default configuration. http://symfony.com/distributionsWednesday, January 11, 2012
  • 29. Symfony 2 Getting Started Symfony Standard Distribution • Directory structure • Default configuration • Bundles ⁃ DoctrineBundle ⁃ JMSSecurityExtraBundle ⁃ SensioDistributionBundle ⁃ SensioFrameworkExtraBundle ⁃ SensioGeneratorBundle ⁃ AsseticBundle http://symfony.com/distributionsWednesday, January 11, 2012
  • 30. Symfony 2 Getting StartedWednesday, January 11, 2012
  • 31. Symfony 2 Getting StartedWednesday, January 11, 2012
  • 32. Symfony 2 Directory StructureWednesday, January 11, 2012
  • 33. Symfony 2 Directory StructureWednesday, January 11, 2012
  • 34. Symfony 2 Directory StructureWednesday, January 11, 2012
  • 35. Symfony 2 Directory StructureWednesday, January 11, 2012
  • 36. Symfony 2 Configuration Files - app/config.ymlWednesday, January 11, 2012
  • 37. Symfony 2 Configuration Files - app/parameters.iniWednesday, January 11, 2012
  • 38. Symfony 2 Configuration Files - app/config_dev.ymlWednesday, January 11, 2012
  • 39. Browser Request Bootstrap (app.php) Controller Template ResponseWednesday, January 11, 2012
  • 40. Bootstrap (app.php)Wednesday, January 11, 2012
  • 41. Symfony 2 Bootstrap File - web/app.phpWednesday, January 11, 2012
  • 42. ControllersWednesday, January 11, 2012
  • 43. ControllersWednesday, January 11, 2012
  • 44. ControllersWednesday, January 11, 2012
  • 45. ControllersWednesday, January 11, 2012
  • 46. TemplatesWednesday, January 11, 2012
  • 47. Templating / Twig Comments: {# comments are not rendered #} {# multi-line comments! {{ var }} #} Output variables: {{ var }} {{ var | upper }} {{ var | raw }} {{ object.property }} {{ true ? ‘yes’ : ‘no’ }} http://twig.sensiolabs.org/Wednesday, January 11, 2012
  • 48. Templating / Twig Blocks: {% set var = ‘hello’ %} {% set foo = var ~ ’ and goodbye’ %} {% if foo is ‘bar’ %} ... {% else %} ... {% endif %} http://twig.sensiolabs.org/Wednesday, January 11, 2012
  • 49. Templating / Twig Blocks: {% for key, val in list %} {{ loop.index }}. {{ val }} {% else %} No keys. {% endfor %} http://twig.sensiolabs.org/Wednesday, January 11, 2012
  • 50. Templating / Twig Extends: {% extends "Bundle::layout.html.twig" %} Include: {% include “Bundle:Demo:template.html.twig” %} Render: {% render “Bundle:Demo:action” %} http://twig.sensiolabs.org/Wednesday, January 11, 2012
  • 51. Awesome Twig Presentations Twig, The Flexible, Fast and Secure Template Language for PHP - Fabien Potencier http://www.slideshare.net/fabpot/twig-the-flexible-fast-and-securetemplate- language-for-php Being Dangerous with Twig - Ryan Weaver http://slideshare.net/weaverryan/being-dangerous-with-twig-symfony- live-paris Twig avanzado - Javier Eguiluz http://www.slideshare.net/javier.eguiluz/twig-avanzado-sf2vigo (Spanish)Wednesday, January 11, 2012
  • 52. Templating / Twig layout.html.twigWednesday, January 11, 2012
  • 53. Templating / Twig index.html.twigWednesday, January 11, 2012
  • 54. Templating / Twig index.html.twigWednesday, January 11, 2012
  • 55. BundlesWednesday, January 11, 2012
  • 56. Bundles Everything in Symfony2 is contained in BundlesWednesday, January 11, 2012
  • 57. Bundles Even Symfony2 is a collection of BundlesWednesday, January 11, 2012
  • 58. Symfony 2 Directory StructureWednesday, January 11, 2012
  • 59. Symfony 2 Bundles Registration - app/AppKernel.phpWednesday, January 11, 2012
  • 60. Bundles ShowcaseWednesday, January 11, 2012
  • 61. Bundles ShowcaseWednesday, January 11, 2012
  • 62. Bundles ShowcaseWednesday, January 11, 2012
  • 63. Bundles ShowcaseWednesday, January 11, 2012
  • 64. Bundles ShowcaseWednesday, January 11, 2012
  • 65. Bundles Showcase And many many more!Wednesday, January 11, 2012
  • 66. FormsWednesday, January 11, 2012
  • 67. Forms DefinitionWednesday, January 11, 2012
  • 68. Forms PresentationWednesday, January 11, 2012
  • 69. Forms ProcessingWednesday, January 11, 2012
  • 70. Web Debug Toolbar & ProfilerWednesday, January 11, 2012
  • 71. Web Debug Toolbar / ProfilerWednesday, January 11, 2012
  • 72. CLI, Generator Commands DemoWednesday, January 11, 2012
  • 73. Twig Silex Ecosystem ORM & ODM Deployments BDD Framework Web Acceptance TestingWednesday, January 11, 2012
  • 74. Who uses Symfony2?Wednesday, January 11, 2012
  • 75. Who uses Symfony2?Wednesday, January 11, 2012
  • 76. Who uses Symfony2?Wednesday, January 11, 2012
  • 77. Who uses Symfony2?Wednesday, January 11, 2012
  • 78. Who uses Symfony2?Wednesday, January 11, 2012
  • 79. Who uses Symfony2?Wednesday, January 11, 2012
  • 80. You?Wednesday, January 11, 2012
  • 81. You should :-)Wednesday, January 11, 2012
  • 82. Questions?Wednesday, January 11, 2012
  • 83. Wednesday, January 11, 2012
  • 84. Thank you! Slides: http://slideshare.net/pgodel Twitter: @pgodel IRC Freenode: pgodel E-mail: pablo@servergrove.comWednesday, January 11, 2012