Ok, it's good to know I'd need to use the pattern-matching router and
not the parametric one.

Basically what I'm trying to do is avoid having all my controllers in
the one directory - in a recent Kohana project for example I had them
split up in different subdirectories, according to user role: admin,
manager etc. So for now I'll just have to have controllers called
admin_courses, admin_users, admin_files etc. and have those in the
URLs - when I've got more time I'll work out how to change the URLs
(which shouldn't affect how the app works if I don't hard code any
URLs I'm assuming)


On Aug 14, 6:08 pm, Jonathan Lundell <[email protected]> wrote:
> On Aug 14, 2011, at 3:26 AM, fishwebby wrote:
>
> > I'm struggling with the routing in web2py and I'm hoping someone can
> > point me in the right direction (I'm a web2py newbie).
>
> > I want to change this (which works):
>
> >http://127.0.0.1:8000/init/admin_courses/index
>
> > to this:
>
> >http://127.0.0.1:8000/admin/courses
>
> You could probably figure out how to do this eventually using the 
> pattern-matching router (the parametric router won't do it for you), but it's 
> going to be a lot easier if you start out without the need to rename/split 
> controller items.
>
> It's hard to say what would work best without knowing more about the patterns 
> you'd see and the controllers and functions you have.
>
>
>
>
>
>
>
>
>
> > but I can't get it to work with the variousroutes.pyfiles. I've
> > followed the suggestions here:
> >http://wiki.web2py.com/URL_Re_writing
> > and here:
> >http://www.web2py.com/book/default/chapter/04#URL-Rewrite
>
> > and various others from this forum but I can't get anything other than
> > "invalid request".
>
> > I want to do this for various controllers, for example:
>
> >http://127.0.0.1:8000/admin/users
> >http://127.0.0.1:8000/admin/users/3/assignments
>
> > (I'm coming from Rails / Symfony / Kohana so perhaps I'm trying to do
> > something that isn't the web2py way?)
>
> > If anyone can point me in the right direction it would be greatly
> > appreciated!

Reply via email to