News Feed
Sections




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

SitePoint PHP Blog:
Fast PHP Routing with PHRoute
August 08, 2014 @ 12:16:28

The SitePoint PHP blog has a new post by Francesco Malatesta showing how to use the PHPRoute routing library to handle routing of requests quickly and easily.

PHRoute is an interesting package: it's a fast regular expression based router that you can easily implement in small to medium projects. However, it's not just very fast: there are filters, filter groups and named routes. You can also use a basic controllers system if things are getting bigger. That said, today we will see how to use it and how to implement its features in a sample project. Also, we are going to see what's under the hood: PHRoute is a result of many experiments and tests by different people.

Once installed (via Composer), he shows you how to use it in a simple project that manages book information, including authors and categories. He includes some code examples showing how to set up some simple routes and handle the execution of a closure to fulfill the request. He also shows how to work with parameters in routes, using different verbs, working with filters and working with route grouping. The post ends with a look at using controllers with the routing, making it easier to create more modular architectures.

0 comments voice your opinion now!
routing phproute tutorial introduction

Link: http://www.sitepoint.com/fast-php-routing-phroute/

blog comments powered by Disqus

Similar Posts

PHPRiot.com: Reducing a Map Path Using Douglas-Peucker Algorithm

Gonzalo Ayuso: Dynamic routes with AngularJS and Silex

PHPit.net: Image manipulation with PHP & the GD library (Part 1)

ZendCasts.com: SLIMming Out Your Controller

Pádraic Brady's Blog:Doing that thing called PEAR - Packaging Source Code for PEAR Distribution


Community Events





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


conference library laravel composer opinion series language artisanfiles voicesoftheelephpant version community podcast interview security list tool framework release symfony introduction

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