Introduction to symfony2

download Introduction to symfony2

of 84

  • date post

    07-May-2015
  • Category

    Technology

  • view

    10.207
  • download

    0

Embed Size (px)

Transcript of Introduction to symfony2

  • 1.Introduction toby Pablo GodelJan 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 2007symfony is a full-stack framework, a libraryof cohesive classes written in PHP- Several libraries put together (modied Mojavi, Propel, Pradoi18n, etc)- Concepts borrowed from several languages and frameworks - Routing, CLI, functional tests,YAML, helpers- One of rst 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.0Highlights - Web Debug ToolbarWednesday, January 11, 2012 9. symfony 1.0Highlights - Admin GeneratorWednesday, January 11, 2012 10. symfony 1.0Highlights - Command Line InterfaceWednesday, January 11, 2012 11. symfony 1.0Highlights - Documentation- A Gentle Introduction to symfony- Practical symfony (jobeet tutorial)- The symfony Reference Book- More with symfony- The API documentationhttp://www.symfony-project.org/doc/1_4/Wednesday, January 11, 2012 12. symfony 1.0Highlights - 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.0Highlights - PluginsWednesday, January 11, 2012 14. symfony 1 vs. Symfony 2 Same philosophy Rewritten from scratchWednesday, January 11, 2012 15. symfony 1 vs. Symfony 2symfony 1 != Symfony2Wednesday, January 11, 2012 16. symfony 1 vs. Symfony 2If you used symfony 1.x better forget about it.Wednesday, January 11, 2012 17. Symfony 2First, 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 221 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.htmlBlog post series about creating a framework based onthe 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 betareleases, 6 release candidates, 9 stable releases) Extensible through the creation of Bundles (replacement forsf1 plugins) Flexible configuration using YAML, XML, annotations orPHP All configuration is compiled to PHP code and cached Lots of unit tests Source code audited by independent security firm thanks todonations 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 2Community 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 2Highlights - SensioLabs ConnectWednesday, January 11, 2012 25. Symfony 2Highlights - BundlesWednesday, January 11, 2012 26. Symfony 2Getting Startedhttp://symfony.com/downloadWednesday, January 11, 2012 27. Symfony 2 Getting Started tar zxf Symfony_Standard_Vendors_2.0.9.tgzorunzip Symfony_Standard_Vendors_2.0.9.zipWednesday, January 11, 2012 28. Symfony 2Getting Started Distributions A Symfony distribution is made up of Symfony2components, 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 conguration Bundles DoctrineBundle JMSSecurityExtraBundle SensioDistributionBundle SensioFrameworkExtraBundle SensioGeneratorBundle AsseticBundlehttp://symfony.com/distributionsWednesday, January 11, 2012 30. Symfony 2Getting StartedWednesday, January 11, 2012 31. Symfony 2Getting StartedWednesday, January 11, 2012 32. Symfony 2Directory StructureWednesday, January 11, 2012 33. Symfony 2Directory StructureWednesday, January 11, 2012 34. Symfony 2Directory StructureWednesday, January 11, 2012 35. Symfony 2Directory StructureWednesday, January 11, 2012 36. Symfony 2Conguration Files - app/cong.ymlWednesday, January 11, 2012 37. Symfony 2Conguration Files - app/parameters.iniWednesday, January 11, 2012 38. Symfony 2 Conguration Files - app/cong_dev.ymlWednesday, January 11, 2012 39. Browser RequestBootstrap (app.php)Controller Template ResponseWednesday, January 11, 2012 40. Bootstrap (app.php)Wednesday, January 11, 2012 41. Symfony 2Bootstrap 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 / TwigComments:{# 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 / TwigBlocks: {% set var = hello %} {% set foo = var ~ and goodbye %}{% if foo is bar %} ...{% else %} ...{% endif %}http://twig.sensiolabs.org/Wednesday, January 11, 2012 49. Templating / TwigBlocks: {% for key, val in list %}{{ loop.index }}. {{ val }}{% else %}No keys.{% endfor %}http://twig.sensiolabs.org/Wednesday, January 11, 2012 50. Templating / TwigExtends:{% 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 Potencierhttp://www.slideshare.net/fabpot/twig-the-exible-fast-and-securetemplate-language-for-phpBeing Dangerous with Twig - Ryan Weaver http://slideshare.net/weaverryan/being-dangerous-with-twig-symfony- live-parisTwig 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. BundlesEverything in Symfony2 iscontained in BundlesWednesday, January 11, 2012 57. Bundles Even Symfony2 isa collection of BundlesWednesday, January 11, 2012 58. Symfony 2Directory 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. FormsDenitionWednesday, January 11, 2012 68. FormsPresentationWednesday, January 11, 2012 69. FormsProcessingWednesday, January 11, 2012 70. Web Debug Toolbar& ProlerWednesday, January 11, 2012 71. Web Debug Toolbar / ProlerWednesday, January 11, 2012 72. CLI, Generator CommandsDemoWednesday, January 11, 2012 73. Twig Silex EcosystemORM & ODM Deployments BDD FrameworkWeb 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/pgodelTwitter: @pgodelIRC Freenode: pgodelE-mail: pablo@servergrove.comWednesday, January 11, 2012