 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
NetTuts.com: Taming Slim 2.0
by Chris Cornutt 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.
voice your opinion now!
slim microframework tutorial introduction class controller router error handling
Stan Lemon: Aura.Micro - Experimental Replacement for Silex
by Chris Cornutt 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.
voice your opinion now!
auramicro microframework experiment silex router
PHPMaster.com: Web Routing in PHP with Aura.Router
by Chris Cornutt 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.
voice your opinion now!
aura router component tutorial routing framework
Rob Allen's Blog: Module specific bootstrapping in ZF2
by Chris Cornutt 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.
voice your opinion now!
module bootstrap zendframework2 tutorial specific router dispatch
PHPMaster.com: Taking Advantage of PHP's Built-in Server
by Chris Cornutt 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.
voice your opinion now!
builtin server recent router feature test custom tutorial
Michael Nitschinger's Blog: Understanding the Lithium Router - Part 2
by Chris Cornutt 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).
voice your opinion now!
lithium router framework introduction unittest integrationtest
Michael Nitschinger's Blog: Understanding the Lithium Router - Part 1
by Chris Cornutt 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.
voice your opinion now!
lithium router framework introduction
Eran Galperin's Blog: Passing arrays to Zend_Controller_Router
by Chris Cornutt 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.
voice your opinion now!
array zendframework zendcontrollerrouter router patch
Rob Allen's Blog: Zend Framework URLs without mod_rewrite
by Chris Cornutt June 04, 2008 @ 12:50:16
Rob Allen has posted a new entry on getting a Zend Framework application to run correctly even though mod_rewrite (or ISAPI_Rewrite) isn't up and running.
Some of our Zend Framework applications have to run on IIS without ISAPI_Rewrite installed. In these cases we need urls of the form http://www.example.com/index.php?module=mod&controller=con&action=act. I couldn't get this to work out of the box with Zend Framework 1.5, so wrote my own router called App_Controller_Router_Route_RequestVars.
Most of the post is the code for the router (ready for you to cut and paste) but he's also included a usage example of it so you can easily update your bootstrap file to use it.
voice your opinion now!
zendframework url moderewrite isapirewrite router custom
|
Community Events
Don't see your event here? Let us know!
|