Wedge

Public area => The Pub => Off-topic => Topic started by: CJ Jackson on June 20th, 2011, 12:52 AM

Title: Simple & Effective URL Routing System
Post by: CJ Jackson on June 20th, 2011, 12:52 AM
http://cj-jackson.com/2011/06/19/simple-effective-url-routing-system/

What do you guys think about the script?  :)
Title: Re: Simple & Effective URL Routing System
Post by: Nao on June 20th, 2011, 07:52 AM
Same trick as on Wedge eheh :)
Title: Re: Simple & Effective URL Routing System
Post by: CJ Jackson on June 20th, 2011, 03:49 PM
I just updated to script, added rtrim($self, '/'), what I was thinking? forgetting to escape the trailing slash!

Did you try out IIS 7.5 on Windows 7 yet?
Title: Re: Simple & Effective URL Routing System
Post by: Nao on June 21st, 2011, 06:48 PM
IIS? Why?

BTW, I noticed two unsets in your source code... JFYI, unset($a, $b, $c) works fine :)
Title: Re: Simple & Effective URL Routing System
Post by: Eros on June 30th, 2011, 04:50 AM
I'm curious about something....

Why didn't you go with something like:
Code: [Select]
$URI = $_SERVER['PHP_SELF'];

$URI = str_replace("index.php/", "", substr($URI,1,-1));

$Context['Request'] = explode("/",$URI);

For that first part?