News Feed
Sections




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

Master Zend Framework:
HowTo Use Child and Segment Routes to Build Simple Routing Tables
April 03, 2014 @ 11:15:05

Matthew Setter has a new post to his Master Zend Framework site today showing you how to use child and segment routes to create a routing table in your Zend Framework v2 application. These routes are "sub-routes" underneath a main route defined in the main router configuration.

Routing is one of the key requirements in modern applications, especially in Zend Framework 2; but they shouldn't be overly-complicated. Today, we're going to look at how to build a routing table, simply and easily using child and segment routes. [...] But how would we do that? Gladly, it's quite simply, using a combination of [the] two route types: Segment and Child Routes. I've made a complete example, which's available in this Gist. Feel free to skip straight to that. But otherwise, let's step through the annotated version together.

He sets the stage with an example in a "writing pipeline" application that helps him predict his income from his freelance writing. He describes the main controllers and the routing configurations they might share. In his example code, he shows how to define the routes and modify them to use segments and child routes to handle constraints. There's also a section about extracting out the segments from the route.

0 comments voice your opinion now!
child segment routes tutorial routing zendframework2

Link: http://www.masterzendframework.com/tutorial/child-and-segment-routes

blog comments powered by Disqus

Similar Posts

Solar Blog: Solar CLI - Getting Started

PHPBuilder.com: Fundamentals of PHP Superglobals

Michelangelo van Dam's Blog: Quality Assurance on PHP projects - PHP_CodeSniffer

Jani Hartikainen's Blog: Zend_Acl part 1: Misconceptions and simple ACLs

Matthew Leverton\'s Blog: How to add a custom CAPTCHA to phpBB2


Community Events





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


zendserver list release tips api version laravel development series podcast application interview community introduction deployment framework language conference code developer

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