News Feed
Jobs Feed
Sections




News Archive
Looking for more information on how to do PHP the right way? Check out PHP: The Right Way

Fabien Potencier's Blog:
Create your own framework... on top of the Symfony2 Components (part 2)
January 05, 2012 @ 08:11:27

Fabien Potencier is back with the next installment of his "Building a framework on top of Symfony2" tutorial series with this look at using the HttpFoundation component to use the Request and Response classes to handle HTTP interaction. (Part one is here.)

The first step towards better code is probably to use an Object-Oriented approach; that's the main goal of the Symfony2 HttpFoundation component: replacing the default PHP global variables and functions by an Object-Oriented layer.

He shows how using this component not only makes OOP handling of requests/responses simpler, but also helps to make your application more secure through features already included in the HttpFoundation component. Sample code is included showing how to fetch the current request, get filtered values from the superglobals (GET/SERVER/etc) and how to respond with a refactored version of the "Hello world" message from the previous example.

0 comments voice your opinion now!
symfony2 components framework custom tutorial series httpfoundation


blog comments powered by Disqus

Similar Posts

Nick Lo's Blog: Custom View Helpers in Zend Framework

PHPMac.com: Building and Installing Apache 2.2.2 and PHP 5.1.3 (or 5.1.4) on Mac OS X 10.4.6

7php.com: PHP Interview with Taylor Otwell - The Creator of the Laravel Framework

Cohesive Web: PHP serialization or Json

PHPBuilder.com: Ajax and PHP: The Simple Way


Community Events











Don't see your event here?
Let us know!


language composer opinion framework security overview package facebook application component hhvm install introduction code release unittest symfony2 threedevsandamaybe hack podcast

All content copyright, 2014 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework