Symfony2 - Request to Response
Upcoming SlideShare
Loading in...5
×
 

Symfony2 - Request to Response

on

  • 407 views

Key aspects of the road from a request to a response in Symfony2.

Key aspects of the road from a request to a response in Symfony2.

Statistics

Views

Total Views
407
Views on SlideShare
209
Embed Views
198

Actions

Likes
1
Downloads
3
Comments
0

3 Embeds 198

http://www.scoop.it 193
https://twitter.com 3
http://www.google.com 2

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Symfony2 - Request to Response Symfony2 - Request to Response Presentation Transcript

  • Request to Response
  • Key points ● webserver ● front controller ● Kernel ● Events & Listeners ● Controller
  • let’s visualize
  • webserver ● apache ○ htaccess ○ mod_rewrite ● ex : php composer.phar create-project symfony/framework-standard-edition /path/to/workshop-symfony 2.5.* cd /path/to/workshop-symfony php -S localhost:8080 -t web
  • ● app.php vs app_dev.php ● bootstrapping [require_once __DIR__.'/../app/bootstrap.php.cache';] ● autoloading [require_once __DIR__.'/./autoload.php';] ● create Request object [$request = Request::createFromGlobals();] ● handle & send response entry point
  • AppKernel : ● init container ● init bundles HttpKernel : ● transform Request to Response [handle()] Kernel(s) HttpKernel AppKernel AppCache
  • ● EventDispatcher Component Events & Listener
  • ● kernel.request ● kernel.controller ● kernel.view ( when no-response) ● kernel.response ● kernel.finish_request (when response should not modify) ● kernel.terminate (heavy duty stuff) ● kernel.exception (obvious) Main events
  • ● dispatched as soon as a request arrives ● add information to the request, initialize parts of the system, return response if possible ● if any listener returns response the others are not called ● ex : routing, firewall, locale kernel.request
  • ● add version information to request ● some routes should not be available in version 2 - redirect to some page kernel.request - todo
  • ● dispatched after the controller is determined ● initialize things, change the controller before executing ● ex : param converter, info collecting kernel.controller
  • ● handle a preExecute() function on all controllers kernel.controller - todo
  • ● dispatched after we have a response ● modify the response object just before it is sent ● ex : context, webdebug kernel.response
  • ● add an extra header on some routes ● change the title of the page kernel.response - todo
  • That’s all folks