Source for file route.php
Documentation is available at route.php
* dbscript for PHP 4 & 5 - restful crud framework
* @version 0.1.2 -- 19-Feb-2007
* @author Brian Hendrickson <brian@dbscript.net>
* @link http://dbscript.net/
* @copyright Copyright 2007 Brian Hendrickson
* @license http://www.opensource.org/licenses/mit-license.php MIT License
* connects the current URI to a Route,
* establishing the request variable names
* e.g. my_domain/:resource/:id
* maps values into $req->resource and $req->id
* $req->connect( 'virtualdir/:var1/:var2' );
* {@link http://dbscript.net/route}
* @author Brian Hendrickson <brian@dbscript.net>
'controller'=> 'index.php',
foreach ( $this->patterns as $pos => $str ) {
if ( substr( $str, 0, 1 ) == ':' ) {
$url[] = $params[substr( $str, 1 )];
return $base . "?". implode ( '/', $url );
|