News Feed
Sections




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

ServerGrove Blog:
Symfony2 components overview Routing
October 08, 2013 @ 11:45:24

On the ServerGrove blog today Raul Fraile has posted another in their spotlights on individual components of the Symfony2 framework. This time the focus is on Routing, the component that, true to its name, handles the translation from HTTP request to the code path to handle it.

This is the third post of the Symfony2 components series, and this time we are going to cover the Routing component, which maps an HTTP request to a set of configuration variables, which can then be used to execute code using PHP callables. The component simplifies the task of defining friendly URLs, without having to worry about complex and cryptic .htaccess files - hurray!.

He talks about the four main parts of the component - the RouteCollection, RequestContext, UrlMatcher and UrlGenerator - and gives a simple example of their use outside of the full framework context. These include normal paths, ones with parameters and constraints. There's also a bit about performance and its use of "matcher dumpers" to compile down and decrease the overall processing time per request.

0 comments voice your opinion now!
symfony2 framework component routing example introduction

Link: http://blog.servergrove.com/2013/10/08/symfony2-components-overview-routing/

blog comments powered by Disqus

Similar Posts

Padraic Brady's Blog: Example Zend Framework Blog Application Tutorial: Parts 1-8 Revisited

Stuart Herbert's Blog: PHP Components: PHP Components: Shipping Unit Tests With Your Component

MC|Press Online: TechTip: PHP Delivers mail() on IBM System i

Gonzalo Ayuso: Dependency Injection Containers with PHP. When Pimple is not enough.

DevShed: Inserting, Updating and Deleting Database Rows with Code Igniter


Community Events

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


laravel introduction community conference extension version framework api application php7 interview opinion performance release podcast voicesoftheelephpant symfony2 example series library

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