CatchAll method

45 views
Skip to first unread message

kionez

unread,
Jul 22, 2010, 4:06:06 AM7/22/10
to GluePHP
Hi,
for a catchall method, useful in case of an error handler I've
modified a little bit the function stick, at line 63, I add a:

elseif (method_exists($obj, 'CATCHALL')) {
$obj->CATCHALL($matches);
}

and then, in my code I put at the end of the URL array:

'.*' =>
'_error' # error catchall handler

and finally I create a class error:

class _error {
function CATCHALL() {
echo "ERROR"; # there will be the
error handler..
}
}

in order to catch every kind of method in my application.

Is the right way to enable a catchall method? I do something wrong?
I'm testing it and seems that works fine..

thanks in advance :)

k.

Joe

unread,
Jul 22, 2010, 10:14:48 PM7/22/10
to GluePHP
Hello,

As far as I can tell, it looks like a sound implementation. Pretty
cool.

Thanks,
Joe
Reply all
Reply to author
Forward
0 new messages