News Feed
Sections




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

Blitz Agency Blog:
REST Service Routing with PHP and Apache
November 19, 2010 @ 12:12:55

New on the Blitz Agency blog Adam Venturella walks you through his process of creating a simple REST service routing system with the PHP and Apache combination that has the same concepts as Sinatra routing.

This is just a quickie. I had spent some time creating a routing system in PHP for services. The goal was to bypass .htaccess or a vhost configuration file. Basically, I wanted to map endpoints (HTTP methods + paths) to PHP methods. My goal at the time was something similar to Sinatra and/or MVC2 routes.

He shows examples from both the Sinatra documentation and a code example from a MVC2 project that uses the same ideas. His first show with PHP proved to not quite be the right way, so he opted for a combination of Apache mod_rewrite and some PHP to take the mapped values and execute. It also includes support fo rthe "X-HTTP-Method-Override" header if you happen to need it.

0 comments voice your opinion now!
rest sinatra routing apache tutorial


blog comments powered by Disqus

Similar Posts

PHPMac.com: Building and Installing Apache 2 and PHP 5.1.1 on Mac OS X 10.4.3 Tiger

Zend Developer Zone: Installing PHP4 and PHP5 Concurrently on One WinXP Computer

DevShed: Drawing Functions and the GD Library in PHP

Zend Developer Zone: Using YAML With PHP and PECL

HotToForge.com: Installing Cherokee With PHP5 And MySQL Support On Ubuntu 9.10


Community Events





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


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

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