Hello. I would like to use GluePHP in a controller/action/variable
sort of a way.
I want my url's to process like so:
http://www.example.com/CONTROLLER/ACTION/VARIABLE/
for a real world example:
http://www.example.com/user/view/joe/
How can I get each of these parts of the url as named regular
expressions?
Here's what I have so far:
$urls = array(
'/user(?P<action>/[a-zA-Z]*)(?P<user>/[a-zA-Z0-9]*)' =>
'controller_user'
);
but there are a number of problems with that. Mainly, it doesn't work.
Secondly, I have to use a preceding '/' in my switch cases like so:
switch($request['action'])
{
case '/login':
So I need to find a way to make the '/' only be searched for in there
is in fact stuff going on after it, but not add it to the variable.
Also, I just need to get it to work at all ;)
My ideal implementation:
function GET($request)
{
switch($request['action'])
{
case 'view':
echo 'viewing the profile of ' . $request['user'];
}
}