News Feed
Sections




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

MaltBlue.com:
Use RouteMatch in Zend Framework 2 For Easy Routing
May 02, 2013 @ 11:14:22

In the latest to his site Matthew Setter takes a look at easy routing with RouteMatch in Zend Framework 2 applications. The RouteMatch component gives you better control over your routing and lets you define "match paths" for URL to Controller mappings.

Today using Zend Framework 2 RouteMatch, Router and Request objects, I show you an easy way to dynamically update the current route. It's almost painlessly simple. [...] Well, like most things in web application development, what starts out simply in the beginner often grows more complex over time. So too is my once simple route.

His "simple" route started getting a bit out of control when he added in some pagination to the page (and query for the path match). He wanted to figure out how to re-render data with the same filters but show the next page of data. He shows how to use the RouteMatch component to achieve just this. He creates a custom module with a "listViewToolbar" helper that lets you read the router, request and handle the parameters sent via the URL. The "invoke" method is called to render the toolbar in the page, complete with the new settings.

0 comments voice your opinion now!
routematch zendframework2 tutorial routing http toolbar pagination

Link: http://www.maltblue.com/tutorial/use-zend-framework-2-routematch-for-dynamic-routing

blog comments powered by Disqus

Similar Posts

SpyreStudios.com: Connecting with API Data from Instagr.am using PHP

PHPRiot.com: Zend Framework 101: Zend_Soap

PHPMaster.com: Parsing XML With SimpleXML

Grzegorz Godlewski's Blog: Automating software development and deployment

Abhinav Singh's Blog: How to use locks for assuring atomic operation in Memcached?


Community Events





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


series list voicesoftheelephpant introduction framework laravel symfony interview conference api language version composer unittest release configure opinion community tool podcast

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