Your SlideShare is downloading. ×
0
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Starting with Symfony2
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Starting with Symfony2

1,930

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,930
On Slideshare
0
From Embeds
0
Number of Embeds
2
Actions
Shares
0
Downloads
17
Comments
0
Likes
0
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. Starting with
  • 2. About Me● Kevin Bond ● Kitchener, Ontario ● PHP Developer – Symfony2 core/docs contributor kevinbond@gmail.com 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 dont like MVC because thats not how the web works. Symfony2 is an HTTP framework; it is a Request/Response framework. Thats 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 (* dont 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
  • 23. Service Container
  • 24. Get Startedcurl -s http://getcomposer.org/installer | phpcomposer.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 arent shared with anyone else. ● Proxy caches: A proxy is a shared cache as many people can be behind a single one. Its usually installed by large corporations and ISPs to reduce latency and network traffic. ● Gateway caches: Like a proxy, its 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
  • 33. Caching Dynamic Content @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

×