rails type routing possible?

61 views
Skip to first unread message

php<3

unread,
Nov 15, 2011, 9:45:08 AM11/15/11
to GluePHP
i've noticed my class is getting enormous , wondering if i can cut
down the $urls by using a rest approach like rails?

$urls = array(
'/' => index,
'/'.$req_url.'/' => (string)$req_url,
'/'.$req_url.'/\w+/(.*)' => (string)$req_url,
'/'.$req_url.'/\w+/\w+/(.*)' => (string)$req_url
);

as i type this, i'm wondering if i could not cast the initial var as a
string also... atm, my urls is a whole page. a little out of control!

tia

geekcube

unread,
Oct 12, 2012, 2:37:55 PM10/12/12
to glu...@googlegroups.com
it's been a year - still can't find anything about this.
Does anyone know if a webpy-rails approach can be used with phpglue? i sure hope so :)

Guillaume Pasquet

unread,
Oct 15, 2012, 5:36:20 PM10/15/12
to glu...@googlegroups.com
That wouldn't be hard to do.

But I'd worry about the security issues that such a routing involves.
You'd have to restrain the functions that can be run by the routing
library to avoid being cracked. That's not really hard either, but can
be a liability if not done properly.

Guillaume

Greg Milby

unread,
Oct 17, 2012, 1:34:29 PM10/17/12
to glu...@googlegroups.com
how would you go about it?  use reserved namespace (:name).

If you have time, please share your thoughts.

tia,
Reply all
Reply to author
Forward
0 new messages