SlideShare a Scribd company logo
Starting with
About Me
●   Kevin Bond
    ●   Kitchener, Ontario
    ●   PHP Developer
         –   Symfony2 core/docs contributor



        kevinbond@gmail.com
        zenstruck.com
                                              @zenstruck
What is Symfony2?




                    @zenstruck
What is Symfony2?
●   Set of stand-alone, decoupled components




                                           @zenstruck
What is Symfony2?
●   Set of stand-alone, decoupled components
●   Full-stack framework based on these
    components




                                           @zenstruck
What is Symfony2?
●   Set of stand-alone, decoupled components
●   Full-stack framework based on these
    components
●   Community
    ●   Forum/Mailing List/IRC (#symfony on Freenode)
    ●   3rd party bundles (knpbundles.com)
    ●   5000+ watchers / 1300+ forks
    ●   560+ unique contributors
                                                  @zenstruck
Symfony2 Components
            DependencyInjection
              EventDispatcher
              HttpFoundation
               DomCrawler
               ClassLoader
                CssSelector
                HttpKernel
                BrowserKit
                Templating
                Translation
                 Serializer
                 Validator
                 Security
                 Routing
                 Console
                 Process
                  Config
                  Finder
                  Locale
                   Yaml
                   Form

                                  @zenstruck
Projects using Symfony2
●   Assetic (Process)
●   Doctrine2 (Console)
●   PHPUnit (Yaml)
●   Behat
●   Silex
●   Drupal 8
●   Propel
                          @zenstruck
Why use Symfony2?
●   Fast
●   PHP 5.3
●   Well engineered (no singletons)
●   Forces* best practices
●   Extensible and flexible
●   Stable and established
●   Testable
                                      @zenstruck
What Symfony2 is not




                       @zenstruck
What Symfony2 is not




           MVC Framework




                           @zenstruck
What Symfony2 is not




           MVC Framework




                           @zenstruck
HTTP Framework



       Request   Response




                            @zenstruck
HTTP Framework



            Request                   Response

    I don't like MVC because that's not how the web works. Symfony2
    is an HTTP framework; it is a Request/Response framework.
    That's the big deal. The fundamental principles of Symfony2 are
    centered around the HTTP specification. - Fabien Potencier




                                                                      @zenstruck
Bundles
●   Everything is a bundle (even the framework is a collection of core
    bundles)
●   Bundles contain:
    ●   Configuration/Translations/Documentation
    ●   Routes/Controllers/Views
    ●   Public resources (js/css/images)
    ●   Services/Events/Models/Forms etc (* don't make your bundle a library)
    ●   Tests
    ●   NOT VENDOR LIBS
●   Override with child bundle
●   690+ bundles on knpbundles.com
                                                                        @zenstruck
Useful Bundles
●   FOSUserBundle
●   FOSFacebookBundle
●   KnpMenuBundle
●   SonataAdminBundle
●   FOSJsRoutingBundle
●   OAuthBundle
●   JMSI18nRoutingBundle
                           @zenstruck
Anatomy of a Request




                       @zenstruck
Anatomy of a Request
●   Request




                       @zenstruck
Anatomy of a Request
●   Request
●   Kernel




                       @zenstruck
Anatomy of a Request
●   Request
●   Kernel
    ●   Controller




                       @zenstruck
Anatomy of a Request
●   Request
●   Kernel
    ●   Controller
●   Response (html, json, xml, etc...)




                                         @zenstruck
Anatomy of a Request
●   Request
●   Kernel
    ●   Controller
    ●   Exception?
●   Response (html, json, xml, etc...)



                                         @zenstruck
Service Container
Get Started



curl -s http://getcomposer.org/installer | php


composer.phar create-project symfony/framework-standard-edition path/to/install




                                                                      @zenstruck
Demo
“Killer” Feature




                   @zenstruck
“Killer” Feature



         Symfony2 Reverse Proxy




                                  @zenstruck
3 Types of HTTP Cache
●   From the docs:
    ●   Browser caches: Every browser comes with its own local cache that
        is mainly useful for when you hit "back" or for images and other
        assets. The browser cache is a private cache as cached resources
        aren't shared with anyone else.
    ●   Proxy caches: A proxy is a shared cache as many people can be
        behind a single one. It's usually installed by large corporations and
        ISPs to reduce latency and network traffic.
    ●   Gateway caches: Like a proxy, it's also a shared cache but on the
        server side. Installed by network administrators, it makes websites
        more scalable, reliable and performant.


                                                                       @zenstruck
Symfony2 Reverse Proxy
●   Request
●   Kernel
●   Controller
●   Response (html, json, xml, etc...)




                                         @zenstruck
Symfony2 Reverse Proxy
●   Request
●   Reverse Proxy
●   Kernel
●   Controller
●   Response (html, json, xml, etc...)



                                         @zenstruck
Symfony2 Reverse Proxy
●   Request
●   Reverse Proxy
●   Kernel
●   Controller
●   Response (html, json, xml, etc...)
    ●   Set s-maxage header


                                         @zenstruck
Symfony2 Reverse Proxy
●   Request
●   Reverse Proxy
    ●   Cached version?
●   Kernel
●   Controller
●   Response (html, json, xml, etc...)
    ●   Set s-maxage header
                                         @zenstruck
Caching Dynamic Content




                          @zenstruck
Caching Dynamic Content
●   Sub-requests




                          @zenstruck
Caching Dynamic Content
●   Sub-requests
    ●   ESI – Edge Side Includes
        –   Server side sub-requests




                                       @zenstruck
Caching Dynamic Content
●   Sub-requests
    ●   ESI – Edge Side Includes
        –   Server side sub-requests
    ●   CSI – Client Side Includes (new in 2.1)
        –   Uses javascript (hinclude.js)
        –   Client side sub-requests




                                                  @zenstruck
Resources
●   github.com/kbond/gpug-symfony2
●   symfony.com (docs/cookbook)
●   fabien.potencier.org
●   knpbundles.com
●   richardmiller.co.uk
●   knpuniversity.com
●   connect.sensiolabs.com
●   live.symfony.com
●   mnot.github.com/hinclude
                                     @zenstruck

More Related Content

PPTX
T4T Training day - NodeJS
PDF
The Future of library dependency management of Ruby
PDF
OSS Security the hard way
PDF
What's new in RubyGems3
PDF
An introduction and future of Ruby coverage library
PDF
Deep drive into rust programming language
PDF
Automate Yo'self -- SeaGL
PDF
The art of concurrent programming
T4T Training day - NodeJS
The Future of library dependency management of Ruby
OSS Security the hard way
What's new in RubyGems3
An introduction and future of Ruby coverage library
Deep drive into rust programming language
Automate Yo'self -- SeaGL
The art of concurrent programming

What's hot (20)

PPT
Rust Programming Language
PDF
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
PDF
Concurrent Ruby Application Servers
PDF
Ruby projects of interest for DevOps
PPTX
Programming The Arduino Due in Rust
KEY
Building MapAttack
PPTX
How *NOT* to firmware
PPTX
My month with Ruby
PDF
Git+jenkins+rex presentation
PDF
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
PDF
vert.x - life beyond jetty and apache
PDF
Node.js and Ruby
PPTX
Rust 101 (2017 edition)
PDF
Dive into sentry
PPTX
I believe in rust
PDF
vert.x 3.1 - be reactive on the JVM but not only in Java
PDF
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
PDF
The Rust Programming Language
KEY
Ruby On Rails Ecosystem
PDF
From 'Legacy' to 'Edge'
Rust Programming Language
Why Rust? - Matthias Endler - Codemotion Amsterdam 2016
Concurrent Ruby Application Servers
Ruby projects of interest for DevOps
Programming The Arduino Due in Rust
Building MapAttack
How *NOT* to firmware
My month with Ruby
Git+jenkins+rex presentation
Asynchronous IO in Rust - Enrico Risa - Codemotion Rome 2017
vert.x - life beyond jetty and apache
Node.js and Ruby
Rust 101 (2017 edition)
Dive into sentry
I believe in rust
vert.x 3.1 - be reactive on the JVM but not only in Java
Node.js: Whats the Big Deal? Presented and JS Meetup Chicago
The Rust Programming Language
Ruby On Rails Ecosystem
From 'Legacy' to 'Edge'
Ad

Similar to Starting with Symfony2 (20)

PDF
Symfony2 San Francisco Meetup 2009
PDF
Symfony Components 2.0 on PHP 5.3
PDF
Symfony 2 (PHP day 2009)
PDF
Welcome to the Symfony2 World - FOSDEM 2013
PDF
Introduction to symfony2
PDF
Symony2 A Next Generation PHP Framework
PDF
Drupal users group_symfony2
PDF
Symfony 2.0
PDF
Symfony 2 (PHP Quebec 2009)
PDF
Symfony components in the wild, PHPNW12
PDF
Symfony 2
PDF
Symfony 2.0 on PHP 5.3
PDF
Symfony internals [english]
PPTX
PDF
Build powerfull and smart web applications with Symfony2
KEY
Symfony2 - A Short Introduction
PPT
Integrating symfony and Zend Framework
PDF
symfony_from_scratch
PDF
symfony_from_scratch
Symfony2 San Francisco Meetup 2009
Symfony Components 2.0 on PHP 5.3
Symfony 2 (PHP day 2009)
Welcome to the Symfony2 World - FOSDEM 2013
Introduction to symfony2
Symony2 A Next Generation PHP Framework
Drupal users group_symfony2
Symfony 2.0
Symfony 2 (PHP Quebec 2009)
Symfony components in the wild, PHPNW12
Symfony 2
Symfony 2.0 on PHP 5.3
Symfony internals [english]
Build powerfull and smart web applications with Symfony2
Symfony2 - A Short Introduction
Integrating symfony and Zend Framework
symfony_from_scratch
symfony_from_scratch
Ad

Recently uploaded (20)

PDF
Modernizing your data center with Dell and AMD
PPTX
CroxyProxy Instagram Access id login.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PDF
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Big Data Technologies - Introduction.pptx
PDF
cuic standard and advanced reporting.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
madgavkar20181017ppt McKinsey Presentation.pdf
PDF
Sensors and Actuators in IoT Systems using pdf
PDF
DevOps & Developer Experience Summer BBQ
PDF
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Transforming Manufacturing operations through Intelligent Integrations
PDF
SAP855240_ALP - Defining the Global Template PUBLIC.pdf
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PDF
Smarter Business Operations Powered by IoT Remote Monitoring
PDF
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf
Modernizing your data center with Dell and AMD
CroxyProxy Instagram Access id login.pptx
NewMind AI Monthly Chronicles - July 2025
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
How Onsite IT Support Drives Business Efficiency, Security, and Growth.pdf
20250228 LYD VKU AI Blended-Learning.pptx
Big Data Technologies - Introduction.pptx
cuic standard and advanced reporting.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
madgavkar20181017ppt McKinsey Presentation.pdf
Sensors and Actuators in IoT Systems using pdf
DevOps & Developer Experience Summer BBQ
HCSP-Presales-Campus Network Planning and Design V1.0 Training Material-Witho...
Chapter 3 Spatial Domain Image Processing.pdf
Understanding_Digital_Forensics_Presentation.pptx
Transforming Manufacturing operations through Intelligent Integrations
SAP855240_ALP - Defining the Global Template PUBLIC.pdf
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
Smarter Business Operations Powered by IoT Remote Monitoring
[발표본] 너의 과제는 클라우드에 있어_KTDS_김동현_20250524.pdf

Starting with Symfony2

  • 2. About Me ● Kevin Bond ● Kitchener, Ontario ● PHP Developer – Symfony2 core/docs contributor [email protected] zenstruck.com @zenstruck
  • 3. What is Symfony2? @zenstruck
  • 4. What is Symfony2? ● Set of stand-alone, decoupled components @zenstruck
  • 5. What is Symfony2? ● Set of stand-alone, decoupled components ● Full-stack framework based on these components @zenstruck
  • 6. What is Symfony2? ● Set of stand-alone, decoupled components ● Full-stack framework based on these components ● Community ● Forum/Mailing List/IRC (#symfony on Freenode) ● 3rd party bundles (knpbundles.com) ● 5000+ watchers / 1300+ forks ● 560+ unique contributors @zenstruck
  • 7. Symfony2 Components DependencyInjection EventDispatcher HttpFoundation DomCrawler ClassLoader CssSelector HttpKernel BrowserKit Templating Translation Serializer Validator Security Routing Console Process Config Finder Locale Yaml Form @zenstruck
  • 8. Projects using Symfony2 ● Assetic (Process) ● Doctrine2 (Console) ● PHPUnit (Yaml) ● Behat ● Silex ● Drupal 8 ● Propel @zenstruck
  • 9. Why use Symfony2? ● Fast ● PHP 5.3 ● Well engineered (no singletons) ● Forces* best practices ● Extensible and flexible ● Stable and established ● Testable @zenstruck
  • 10. What Symfony2 is not @zenstruck
  • 11. What Symfony2 is not MVC Framework @zenstruck
  • 12. What Symfony2 is not MVC Framework @zenstruck
  • 13. HTTP Framework Request Response @zenstruck
  • 14. HTTP Framework Request Response I don't like MVC because that's not how the web works. Symfony2 is an HTTP framework; it is a Request/Response framework. That's the big deal. The fundamental principles of Symfony2 are centered around the HTTP specification. - Fabien Potencier @zenstruck
  • 15. Bundles ● Everything is a bundle (even the framework is a collection of core bundles) ● Bundles contain: ● Configuration/Translations/Documentation ● Routes/Controllers/Views ● Public resources (js/css/images) ● Services/Events/Models/Forms etc (* don't make your bundle a library) ● Tests ● NOT VENDOR LIBS ● Override with child bundle ● 690+ bundles on knpbundles.com @zenstruck
  • 16. Useful Bundles ● FOSUserBundle ● FOSFacebookBundle ● KnpMenuBundle ● SonataAdminBundle ● FOSJsRoutingBundle ● OAuthBundle ● JMSI18nRoutingBundle @zenstruck
  • 17. Anatomy of a Request @zenstruck
  • 18. Anatomy of a Request ● Request @zenstruck
  • 19. Anatomy of a Request ● Request ● Kernel @zenstruck
  • 20. Anatomy of a Request ● Request ● Kernel ● Controller @zenstruck
  • 21. Anatomy of a Request ● Request ● Kernel ● Controller ● Response (html, json, xml, etc...) @zenstruck
  • 22. Anatomy of a Request ● Request ● Kernel ● Controller ● Exception? ● Response (html, json, xml, etc...) @zenstruck
  • 24. Get Started curl -s http://getcomposer.org/installer | php composer.phar create-project symfony/framework-standard-edition path/to/install @zenstruck
  • 25. Demo
  • 26. “Killer” Feature @zenstruck
  • 27. “Killer” Feature Symfony2 Reverse Proxy @zenstruck
  • 28. 3 Types of HTTP Cache ● From the docs: ● Browser caches: Every browser comes with its own local cache that is mainly useful for when you hit "back" or for images and other assets. The browser cache is a private cache as cached resources aren't shared with anyone else. ● Proxy caches: A proxy is a shared cache as many people can be behind a single one. It's usually installed by large corporations and ISPs to reduce latency and network traffic. ● Gateway caches: Like a proxy, it's also a shared cache but on the server side. Installed by network administrators, it makes websites more scalable, reliable and performant. @zenstruck
  • 29. Symfony2 Reverse Proxy ● Request ● Kernel ● Controller ● Response (html, json, xml, etc...) @zenstruck
  • 30. Symfony2 Reverse Proxy ● Request ● Reverse Proxy ● Kernel ● Controller ● Response (html, json, xml, etc...) @zenstruck
  • 31. Symfony2 Reverse Proxy ● Request ● Reverse Proxy ● Kernel ● Controller ● Response (html, json, xml, etc...) ● Set s-maxage header @zenstruck
  • 32. Symfony2 Reverse Proxy ● Request ● Reverse Proxy ● Cached version? ● Kernel ● Controller ● Response (html, json, xml, etc...) ● Set s-maxage header @zenstruck
  • 34. Caching Dynamic Content ● Sub-requests @zenstruck
  • 35. Caching Dynamic Content ● Sub-requests ● ESI – Edge Side Includes – Server side sub-requests @zenstruck
  • 36. Caching Dynamic Content ● Sub-requests ● ESI – Edge Side Includes – Server side sub-requests ● CSI – Client Side Includes (new in 2.1) – Uses javascript (hinclude.js) – Client side sub-requests @zenstruck
  • 37. Resources ● github.com/kbond/gpug-symfony2 ● symfony.com (docs/cookbook) ● fabien.potencier.org ● knpbundles.com ● richardmiller.co.uk ● knpuniversity.com ● connect.sensiolabs.com ● live.symfony.com ● mnot.github.com/hinclude @zenstruck