Your SlideShare is downloading. ×
The only php framework you'll need: Symfony2 - FOWA Prague
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Introducing the official SlideShare app

Stunning, full-screen experience for iPhone and Android

Text the download link to your phone

Standard text messaging rates apply

The only php framework you'll need: Symfony2 - FOWA Prague

3,704
views

Published on

Published in: Technology

0 Comments
3 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
3,704
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
44
Comments
0
Likes
3
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. THE ONLY PHP FRAMEWORK YOULL NEED: SYMFONY2 Juozas Kaziukėnas // juokaz.com // @juokazThursday, November 29, 12
  • 2. Juozas Kaziukėnas, Lithuanian You can call me Joe Talk to me at @juokaz More info http://juokaz.comThursday, November 29, 12
  • 3. WhiskyWeb.co.ukThursday, November 29, 12
  • 4. A CLASSIC PHP FRAMEWORKThursday, November 29, 12
  • 5. WHAT A FRAMEWORK SHOULD DO?Thursday, November 29, 12
  • 6. WHAT A FRAMEWORK SHOULD DO? • Out of the box functionality • Routing • Security • Best practices • Standardization • Decoupling • etc.Thursday, November 29, 12
  • 7. WHAT IT SHOULD DO, VER 2Thursday, November 29, 12
  • 8. NO PHP FRAMEWORK TO DO IT RIGHTThursday, November 29, 12
  • 9. WRONG ATTEMPTS • Hugely coupled • Hard to override core behavior • Overcomplicated • Low quality • Slow • million other reasonsThursday, November 29, 12
  • 10. FALSE PROMISESThursday, November 29, 12
  • 11. WHAT IS SYMFONY2?Thursday, November 29, 12
  • 12. WHAT IS SYMFONY2? •A successor of symfony 1.X • Rewritten from scratch • Turns requests to responses, that’s it • Heavily utilizes PHP 5.3+ features • Component oriented architecture • Supported by Sensio Labs agency, run by Fabien PotencierThursday, November 29, 12
  • 13. COMPONENTS • Building blocks for the framework • Like: HTTP kernel, Form, Validation, Security, Event dispatcher, Config, Console, etc. • Independent self-contained components • Can be used without using Symfony2 as a web frameworkThursday, November 29, 12
  • 14. SILEX require_once __DIR__./../vendor/autoload.php; $app = new SilexApplication(); $app->get(/hello/{name}, function($name) use($app) { return Hello .$app->escape($name); }); $app->run();Thursday, November 29, 12
  • 15. WHAT SYMFONY2 DOES WELL?Thursday, November 29, 12
  • 16. WHAT SYMFONY2 DOES WELL? • Components • Inspired Composer to be created • Silex vs Symfony2 vs your own • Fully working standard distribution • Service container for dependenciesThursday, November 29, 12
  • 17. STARTING WITH SYMFONY2Thursday, November 29, 12
  • 18. STARTING WITH SYMFONY2 composer.phar create-project symfony/framework-standard-edition path/to/install 2.1.x-dev php ./app/console server:run Browse http://localhost:8000/app_dev.phpThursday, November 29, 12
  • 19. COMPOSER • 3rd party dependency management • Makes life so much easier • Allows not to have 3rd party checked in into a master repo • Project-specific dependencies vs PEAR-like system-wide • One file composer.json to manage all expectations • Became a de facto standard in PHP projectsThursday, November 29, 12
  • 20. BUNDLES • “Modules” to separate application code • Contains controllers, models, templates, etc. • Symfony framework itself is a bundle called FrameworkBundle • Repository of available bundles http://knpbundles.com/ • Can be extended to customizeThursday, November 29, 12
  • 21. BUNDLES // src/Acme/DemoBundle/Controller/WelcomeController.php namespace AcmeDemoBundleController; use SymfonyBundleFrameworkBundleControllerController; class WelcomeController extends Controller { public function indexAction() { return $this->render(AcmeDemoBundle:Welcome:index.html.twig); } }Thursday, November 29, 12
  • 22. SERVICE CONTAINER // app/config/config.yml services: my_mailer: class: AcmeHelloBundleMailer arguments: [sendmail] class WelcomeController extends Controller { public function sendEmailAction() { $mailer = $this->get(my_mailer); $mailer->send(ryan@foobar.net, ...); } }Thursday, November 29, 12
  • 23. COMMUNITYThursday, November 29, 12
  • 24. COMMUNITY • Symfony2 on Twitter • Conferences, user groups • All of this? • Good market to be a developer • Less bugs, active GitHub • DrupalThursday, November 29, 12
  • 25. QUESTIONS?Thursday, November 29, 12
  • 26. THANKS! Juozas Kaziukėnas http://juokaz.com/ @juokazThursday, November 29, 12