<?xml version="1.0"?>
<rss version="2.0">
  <channel>
    <title>PHPDeveloper.org</title>
    <link>http://www.phpdeveloper.org</link>
    <description>Up-to-the Minute PHP News, views and community</description>
    <language>en-us</language>
    <pubDate>Thu, 20 Jun 2013 04:52:53 -0500</pubDate>
    <ttl>30</ttl>
    <item>
      <title><![CDATA[MaltBlue.com: Use RouteMatch in Zend Framework 2 For Easy Routing]]></title>
      <guid>http://www.phpdeveloper.org/news/19536</guid>
      <link>http://www.phpdeveloper.org/news/19536</link>
      <description><![CDATA[<p>
In the latest to his site <i>Matthew Setter</i> takes a look at <a href="http://www.maltblue.com/tutorial/use-zend-framework-2-routematch-for-dynamic-routing">easy routing with RouteMatch</a> in Zend Framework 2 applications. The <a href="http://framework.zend.com/apidoc/2.0/classes/Zend.Mvc.Router.Http.RouteMatch.html">RouteMatch</a> component gives you better control over your routing and lets you define "match paths" for URL to Controller mappings.
</p>
<blockquote>
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.
</blockquote>
<p>
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.
</p>
Link: http://www.maltblue.com/tutorial/use-zend-framework-2-routematch-for-dynamic-routing]]></description>
      <pubDate>Thu, 02 May 2013 11:14:22 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: The MVC Pattern and PHP, Part 2]]></title>
      <guid>http://www.phpdeveloper.org/news/19302</guid>
      <link>http://www.phpdeveloper.org/news/19302</link>
      <description><![CDATA[<p>
PHPMaster.com has posted the <a href="http://phpmaster.com/the-mvc-pattern-and-php-2/">second part of their MVC series</a>, introducing you to the Model/View/Controller design pattern. If you want to catch up, part one <a href="http://phpmaster.com/the-mvc-pattern-and-php-1/">is here</a>.
</p>
<blockquote>
Welcome to part 2 of this two-part series discussing MVC and PHP, where we'll discuss some of the considerations one must make when using an MVC architecture. If you've come straight to this article without reading part 1 first, I encourage you to head back and have careful read as this one will assume that you've read and understand everything it discussed.
</blockquote>
<p>
He talks about some of the things more involved in making a MVC framework including routing and URL formats and working with templates. Sample code is included for the route handling, model/controller relationship and view classes for the templates.
</p>]]></description>
      <pubDate>Tue, 12 Mar 2013 11:19:03 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Vance Lucas: Introducing Bullet: The Functional PHP Micro-Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/18931</guid>
      <link>http://www.phpdeveloper.org/news/18931</link>
      <description><![CDATA[<p>
<i>Vance Lucas</i> has a new post to his site <a href="http://www.vancelucas.com/blog/introducing-bullet-the-functional-php-micro-framework/">sharing at a project</a> he's been working on, a micro-framework for PHP that takes a functional approach to its structure (and the structure of the apps you can make with it), <a href="http://bulletphp.com/">Bullet</a>.
</p>
<blockquote>
<a href="http://bulletphp.com/">Bullet</a> is a new PHP micro-framework with a unique functional approach to URL routing that allows for more flexibility and requires less verbosity than the more typical full route+callback approach found in other micro-frameworks. The main problem with most micro-frameworks and even full-stack MVC frameworks that leads to code duplication is that the callback or method executed to perform the action and respond to the URL route lives fully within its own scope. This means that you are forced to repeat a lot of setup code across URL route handlers that load the same resource, authorize it, etc.
</blockquote>
<p>
He illustrates with an example of a GET/DELETE to the same routes and having to create multiple handlers for each. He restructures this with Bullet and shows how it can nest callbacks inside of handlers to make for simpler routing. It also scopes down requests and gets more fine grained as you nest, making it easier to create reusable handlers (like in other files). If you're interested in finding out more about Bullet and its structure, you can find it in <a href="http://bulletphp.com/">the project's main site</a>.
</p>]]></description>
      <pubDate>Fri, 21 Dec 2012 09:02:00 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: An Introduction to the Front Controller Pattern, Part 1]]></title>
      <guid>http://www.phpdeveloper.org/news/18298</guid>
      <link>http://www.phpdeveloper.org/news/18298</link>
      <description><![CDATA[<p>
If you've done any work with PHP frameworks, the concept of a "front controller" should be a familiar one. If you haven't, the idea might be new to you and PHPMaster.com has started off a series <a href="http://phpmaster.com/front-controller-pattern-1/">that will introduce you to the basics</a> of the Front Controller design pattern in a few different parts.
</p>
<blockquote>
Some are now grumbling about newer concepts that have recently made inroads in day-to-day PHP development, saying Front Controllers are a redundant "reinvention of the wheel" which should be discarded ipso facto. [...] In this two-part article I'll be exploring in depth a couple of straightforward approaches that you might find appealing, especially if you're trying to implement an expandable front controller from scratch without sweating excessively during the process or having to cope with the burdens of a bloated framework.
</blockquote>
<p>
This <a href="http://phpmaster.com/front-controller-pattern-1/">first part</a> of the series introduces you to some of the basic concepts of routing and URL handling and shares the code for a basic front controller. It parses the URL and sets up the controller and action to hand the request off to. Also included is the contents for the .htaccess file you'll need to include to route all requests back through this controller instance.
</p>]]></description>
      <pubDate>Tue, 31 Jul 2012 13:31:12 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPMaster.com: Web Routing in PHP with Aura.Router]]></title>
      <guid>http://www.phpdeveloper.org/news/18104</guid>
      <link>http://www.phpdeveloper.org/news/18104</link>
      <description><![CDATA[<p>
On PHPMaster.com today there's a new tutorial showing how to <a href="http://phpmaster.com/web-routing-in-php-with-aura-router/">route your web requests</a> with the Aura.Router component from the <a href="https://github.com/auraphp">AuraPHP</a> component framework.
</p>
<blockquote>
Everyone is interested in SEO-friendly, REST-style URLs. Apache can do URL routing via mod_rewrite rules, but it's hard and error prone. Why not use PHP itself to handle routing instead? Aura is a independent collection of libraries for PHP 5.4 brought to you by <a href="http://paul-m-jones.com/">Paul M Jones</a>. Here we are going to introduce you Aura.Router. Aura.Router is a simple and easy web routing library for PHP. In this article you will learn how to create routes which are SEO-friendly, REST-style URLs with the help of PHP.
</blockquote>
<p>
He walks you through the download and install of the Aura.Router component (separate from the framework) and how to set up the mod_rewrite rules to work with it and a front controller. He includes some code for a basic usage, showing the mapping of a default route and more complex routes with named parameters. He also shows how to use the "match" method to find the route that was matched and how to dispatch/hand off the routing to a controller. 
</p>]]></description>
      <pubDate>Mon, 18 Jun 2012 08:19:16 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lukas Smith's Blog: Query parameter handling in Symfony2]]></title>
      <guid>http://www.phpdeveloper.org/news/17954</guid>
      <link>http://www.phpdeveloper.org/news/17954</link>
      <description><![CDATA[<p>
<i>Lukas Smith</i> is <a href="http://pooteeweet.org/blog/0/2096#m2096">looking for feedback</a> about a question that's been in his mind a lot lately - can the handling of query parameters be made better for the <a href="http://symfony.com">Symfony2</a> framework (and even easier to use).
</p>
<blockquote>
Obviously you can already access query parameters today already but it could be easier. Essentially what I want is a way for developers to easily configure what query parameters they expect and what values they expect. This is useful for several things like easier reading and validating of query parameters, self documenting API both for <a href="https://github.com/nelmio/NelmioApiDocBundle">API docs</a> for humans but also <a href="https://github.com/FriendsOfSymfony/FOSRestBundle/issues/52">for machines</a>.
</blockquote>
<p>
He's asking for feedback and ideas from the community on a <a href="https://github.com/FriendsOfSymfony/FOSRestBundle/pull/185">proposed solution</a> that could make things more flexible. He also briefly mentions the route matching and how qurey parameters could cause them not to match:
</p>
<blockquote>
For one I don't think that a mismatch on a <a href="http://symfony.com/doc/master/book/routing.html#adding-requirements">route requirement</a> of a query parameter cause the route to not match. However then it can quickly become confusing for the end user or it would require adding more and more syntax to handle all the different cases.
</blockquote>]]></description>
      <pubDate>Mon, 14 May 2012 11:56:37 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Lorna Mitchell's Blog: Building A RESTful PHP Server: Routing the Request]]></title>
      <guid>http://www.phpdeveloper.org/news/17433</guid>
      <link>http://www.phpdeveloper.org/news/17433</link>
      <description><![CDATA[<p>
<i>Lorna Mitchell</i> is back with a second installment in her "Building a RESTful PHP Server" series with <a href="http://www.lornajane.net/posts/2012/building-a-restful-php-server-routing-the-request">this new post</a> about handling and routing the incoming requests. (You can find the first part about working with the request <a href="http://phpdeveloper.org/news/17418">here</a>)
</p>
<blockquote>
This is the second part of a series, showing how you might write a RESTful API using PHP. This part covers the routing, autoloading, and controller code for the service, and follows on from the first installment which showed how to parse the incoming request to get all the information you need.
</blockquote>
<p>
She shows how to grab the controller name from the incoming request (based on her previous code), create the object for it and execute the requested action name. Also included is a sample autoloader and a basic controller - a UsersController with "getAction" and "postAction" 
 methods for responding to GET and POST requests.
</p>]]></description>
      <pubDate>Mon, 23 Jan 2012 11:14:11 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[PHPBuilder.com: Building RESTful Web Services with the Zend Framework]]></title>
      <guid>http://www.phpdeveloper.org/news/17120</guid>
      <link>http://www.phpdeveloper.org/news/17120</link>
      <description><![CDATA[<p>
New on PHPBuilder.com today is a tutorial introducing you to <a href="http://www.phpbuilder.com/columns/RESTful_Web_Services_with_Zend/RESTful_Web_Services_with_Zend_11-03-2011.php3">web services with the Zend Framework</a>, a guide to creating a simple RESTful service with this popular PHP framework.
</p>
<blockquote>
Rather than attempt to build and maintain multiple versions of the Web application in order to accommodate the diverse array of challenges and advantages presented by each device type, developers are increasingly embracing a unified approach which allows them to manage a single server-side code base which communicates with multiple client-specific interfaces by way of a RESTful Web service. The Zend Framework's <a href="http://framework.zend.com/manual/en/zend.rest.html">Zend_Rest</a> component offers PHP developers with an incredibly straightforward approach to building RESTful Web services. 
</blockquote>
<p>
He shows how to set up some internal RESTful routing (with the help of <a href="http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.routes.rest">Zend_Rest_Route</a>) and create a simple controller that responds to several of the major HTTP request types - POST, GET, PUT, etc. In his simple example, he shows how to update a basic TODO list with a POST and the JSON response that would follow.
</p>]]></description>
      <pubDate>Fri, 11 Nov 2011 11:37:45 -0600</pubDate>
    </item>
    <item>
      <title><![CDATA[ZendCasts.com: SLIMming Out Your Controller]]></title>
      <guid>http://www.phpdeveloper.org/news/17007</guid>
      <link>http://www.phpdeveloper.org/news/17007</link>
      <description><![CDATA[<p>
On the ZendCasts.com site today, they branch out from just talking about Zend Framework-related topics and take a look at he <a href="http://www.slimframework.com/">Slim micro-framework</a> in <a href="http://www.zendcasts.com/slimming-out-your-controller/2011/10/">this new screencast</a>.
</p>
<p>
He introduces the framework as a light-weight, easy to use tool that doesn't include "all of that extra stuff". He walks you through the creation of a (very) simple site that includes some basic templating too. At the end of the screencast he hints at the next part of the series - creating a simple JSON endpoint as a RESTful web service.
</p>
<p>
You can find out more about the Slim framework <a href="http://www.slimframework.com/">on its site</a> that includes documentation and a <a href="http://dev.slimframework.com/phpdocs/">PHPDoc generated manual</a> for every part of the code.
</p>]]></description>
      <pubDate>Tue, 18 Oct 2011 11:02:58 -0500</pubDate>
    </item>
    <item>
      <title><![CDATA[Gonzalo Ayuso's Blog: Building a small microframework with PHP]]></title>
      <guid>http://www.phpdeveloper.org/news/16756</guid>
      <link>http://www.phpdeveloper.org/news/16756</link>
      <description><![CDATA[<p>
In investigating microframeworks and some of the offerings out there <i>Gonzalo Ayuso</i> has done a little exploring of his own. He's <a href="http://gonzalo123.wordpress.com/2011/08/22/building-a-small-microframework-with-php/">worked up a basic microframework</a> and shared it in a new post as a sort of academic exercise.
</p>
<blockquote>
Nowadays microframewors are very popular. Since Blake Mizerany created <a href="http://www.sinatrarb.com/">Sinatra</a> (Ruby), we have a lot of Sinatra clones in PHP world. Probably the most famous (and a really good one) is <a href="http://silex-project.org/">Silex</a>. But we also have several ones, such as <a href="http://www.limonade-php.net/">Limonade</a>, <a href="http://gluephp.com/">GluePHP</a> and <a href="http://www.slimframework.com/">Slim</a>. Those frameworks are similar. 
</blockquote>
<p>
He looks at how several of these frameworks handle routing and setup, mostly using the closures/anonymous function callbacks available in PHP 5.3. His <a href="https://github.com/gonzalo123/microFramework">simple example framework</a> does some basic URI handling to find the requested module, class and function (action) to call. You can even define the output format from options like json, txt, css, js and jsonp. A sample "controller" is included with a "Hello world" and there's a mention of some other options he's exploring including <a href="http://twig-project.org">Twig</a> and <a href="https://github.com/kriswallsmith/assetic">Assetic</a> integration.
</p>]]></description>
      <pubDate>Tue, 23 Aug 2011 09:48:27 -0500</pubDate>
    </item>
  </channel>
</rss>
