Routing trees and its decendants

2 messages Options
Embed this post
Permalink
David Gonzalez

Routing trees and its decendants

Reply Threaded More More options
Print post
Permalink
I've been wondering, how would I route a hierarchical tree? like

http://localhost/Services/WebDevelopment/ or (better)

http://myblog/parentCategory/subcategory1/subsubcategory2/article-id

been trying but it seems I need a little push to make a breakthrough =/

Thanks in advance,
David
prodigitalson

Re: Routing trees and its decendants

Reply Threaded More More options
Print post
Permalink
I would use a regex route like myblog/:categories/:articleid then i would extract the individual categories myself from the single categories route segment in the controller or in a  front controller plugin. I think that would be the simplest way.

If you need more control directly in the router i think you could put something together with the route chain but i havent dived into that yet so i cant offer advice there.

David G. wrote:
I've been wondering, how would I route a hierarchical tree? like

http://localhost/Services/WebDevelopment/ or (better)

http://myblog/parentCategory/subcategory1/subsubcategory2/article-id

been trying but it seems I need a little push to make a breakthrough =/

Thanks in advance,
David