News Feed
Sections




News Archive
feed this:

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

Aura Framework Blog:
A Peek At Aura v2 -- Aura.Router
November 19, 2013 @ 12:12:05

On the Aura Framework blog, they continue their look ahead at the coming version of another of the framework's components, the Aura v2 Router. The Aura framework is a decoupled, modular framework that focuses on minimizing dependencies.

Lately, we've been going over the migration of v2 packages from v1. Today, I'll talk about the updated Aura.Router v2 package. While not an example of extracting a new package from an existing one, it has a couple of features that other routers don't currently have, in addition to being truly independent and completely decoupled from any other package.

They focus on some of the basics (more detailed information can be found on the package page) of the package's new features and its focus on routing rather than dispatching. Sample code is included showing it in use. The examples show basic routing, routing by server values and attaching route groups. There's also a brief section about adding REST routes via an "attachResource" method call.

0 comments voice your opinion now!
aura framework component spotlight router

Link: http://auraphp.com/blog/2013/11/18/aura-v2-router/

NetTuts.com:
Taming Slim 2.0
April 02, 2013 @ 09:17:11

On NetTuts.com today there's a new tutorial posted about "taming" Slim 2.0, the latest version of the popular PHP microframework. They look at application structure and share some tips to using this update.

Slim is a lightweight framework that packs a lot of punch for its tiny footprint. It has an incredible routing system, and offers a solid base to work from without getting in your way. Let me show you! But that's not to say that Slim doesn't has some issues; it's one-file setup becomes cluttered as your application grows. In this article, we'll review how to structure a Slim application to not only sustain, but improve its functionality and keep things neat and systematic.

He starts with an example of "vanilla Slim" and looks some at what's happening behind the scenes in the routing engine. They then give you a step by step installation and usage guide including updating the router to use class files. An example controller is included as well as some basic error handling using a Twig template for use across the application.

0 comments voice your opinion now!
slim microframework tutorial introduction class controller router error handling


Stan Lemon:
Aura.Micro - Experimental Replacement for Silex
December 14, 2012 @ 09:29:12

With all of the recent talk about the Aura framework that's been happening lately, Stan Lemon thought it would be interesting to see how a microframework based on the Aura packages would be to create. He's posted about his experiences on his site today.

I was recently working on a small project that used Silex. As I browsed my vendor folder, I realized how much extra "stuff" I had inherited with Silex. There were a bunch of other components required when all I wanted was some quick and easy routing, micro-framework style. When I think about going lean I always find myself coming back to Aura. Micro-frameworks are not a new to idea to Aura, so I wondered if I could take the elegance and ease of Silex by wrapping up Aura.Router and exposing it through a similar API.

The result of his work is Aura.Micro, a simple microframework that really just handles routing (unlike Silex with builds on the Pimple DI as well). He includes an example of it in use, defining several different kinds of actions on the routing like "before", "finish" and a few "get" routes.

0 comments voice your opinion now!
auramicro microframework experiment silex router


PHPMaster.com:
Web Routing in PHP with Aura.Router
June 18, 2012 @ 08:19:16

On PHPMaster.com today there's a new tutorial showing how to route your web requests with the Aura.Router component from the AuraPHP component framework.

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 Paul M Jones. 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.

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.

0 comments voice your opinion now!
aura router component tutorial routing framework


Rob Allen's Blog:
Module specific bootstrapping in ZF2
March 08, 2012 @ 10:04:20

Rob Allen has a new post to his blog today looking at bootstrapping specific modules in a Zend Framework 2-based application without having to do the entire set.

Following on from the discussion on modules, we can hook into the event system to do module specific bootstrapping. By this, I mean, if you have some code that you want to run only if the action to be called is within this module, you can hook into the Application's dispatch event to achieve this.

He starts with an example of a basic module (Simple/Module.php) and shows how to define an "onBootstrap" method that calls the "onDispatch" method (when hooked to the event manager) to do some module-specific bootstrap operations. The RouteMatch feature is used to ensure that you're in the right controller/namespace combo to use the module.

0 comments voice your opinion now!
module bootstrap zendframework2 tutorial specific router dispatch


PHPMaster.com:
Taking Advantage of PHP's Built-in Server
March 08, 2012 @ 08:17:45

On PHPMaster.com today there's a new tutorial for those on the bleeding edge of PHP using the latest released version (5.4) and a feature that comes with it - using the built-in webserver that comes bundled for testing purposes.

One of the cooler features of the new PHP 5.4 release is a built-in web server designed specifically for development and testing. Now you can write and test your code without having to have a full-fledged LAMP configuration - just launch a the built-in server from the command line, test your code, and then shut it down when you're finished. [...] In this article I'll explain some basic uses of the new built-in server and show you how to build a portable personal development server useful for quickly testing your applications

He starts with a look at how to start up the web server (a simple command line switch and host/port definition) and the resulting default phpinfo page it displays. Other options include the ability to specify a document root for your server and create a sort of "front controller" for it to route requests. They show how to create a simple application based on this that can dynamically load in the index file, a router and pass the request off to the correct file. Their example includes some "niceties" too like logging, "hosts allowed" and checks for requesting directories.

You can find their full code for this example over on github.

0 comments voice your opinion now!
builtin server recent router feature test custom tutorial


Michael Nitschinger's Blog:
Understanding the Lithium Router - Part 2
February 25, 2011 @ 08:40:41

In his latest post Michael Nitschinger extends his first look at the Lithium framework's routing system with part two of his series - creating some unit and integration tests to help you understand how the various parts work.

Routes play an essential role in your request/response-cycle and therefore should also be tested like any other component that you develop. As the Lithium routing infrastructure also consists of classes and methods, we can run unit and integration tests against them.

Some of the tests include checking for basic request to controller mapping, testing with an ID in the request, using the export() method and testing various routing to ensure that the output is correct (the integration tests).

0 comments voice your opinion now!
lithium router framework introduction unittest integrationtest


Michael Nitschinger's Blog:
Understanding the Lithium Router - Part 1
February 07, 2011 @ 13:55:11

Michael Nitschinger has posted the first part of a series about the internals of the Lithium routing system in the Lithium PHP 5.3 framework.

In this article series we'll take an in-depth look at the Lithium router. This first part bootstraps your knowledge and lays a foundation for more advanced topics.

He introduces the Router component as having two purposes - matching a URL against the code to handle the request and the other is the reverse, creating URLs out of routes. He links to two pages where you can find more details on its API. He moves on to the request and response cycle the Router goes through each time a page is requested and walks you through some code to help it all make sense. There's also a bit at the end about creating URLs with the reverse routing methods.

0 comments voice your opinion now!
lithium router framework introduction


Federico Cargnelutti's Blog:
An Alternative to Zend_Controller The Router
April 09, 2009 @ 08:44:44

Federico has continued his look at his alternative to the Zend_Controller component of the Zend Framework - Zf_Controller in this new part of the series focusing on routing.

Here's the good news: Zf_Controller doesn't have a Router. It uses a very simple mapping to determine the name of the controller and action.

He gives an example of the "non-routing" and how to work with the input variables for the controller instance - defining default values and setting requirements for them (as defined by matching a regular expression).

You can read more about the first part of the series here.

0 comments voice your opinion now!
zendcontroller zendframework alternative router variable zfcontroller


Eran Galperin's Blog:
Passing arrays to Zend_Controller_Router
July 01, 2008 @ 09:31:52

Eran Galperin has posted a few hacks you can use for the Zend Framework's Router system to make passing arrays easy and integrated.

A big advantage to using the front controller in the Zend Framework is the ability to create nicely formatted urls. [...] The implementation of the default router in the Zend Framework (Zend_Controller_Router_Rewrite) does not allow for passing arrays in this manner though, since previously set keys get overwritten if they are declared more than once. This is somewhere between semi-annoying to very annoying, so lets get straight to hacking it into submission.

His patch only changes one line in the Zend_Controller_Router_Route_Module component - changing it from assigning to a conditional checking for the existence of an array and setting it appropriately.

0 comments voice your opinion now!
array zendframework zendcontrollerrouter router patch



Community Events





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


interview language symfony2 release api podcast threedevsandamaybe refactor introduction community list framework developer code laravel opinion install series testing unittest

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