Welcome Guest, Not a member yet? Register   Sign In
Help with full "fake" directory structure URL
#4

[eluser]alphane[/eluser]
Okay, I think I can see where I've gotten you all confused.

(I've tried to explain without using the word page, but I'm at a loss how to!)

Basically, I want a CMS-like dynamic ability to create many web-pages within a hierarchical structure. So for example a web page called "About us" may have child-pages called "Our Mission" and "The Team".

To access these pages I desire a URL structure that reflects these pages relationship, so accessing www.site.com/about-us would give the about us page. From this page, if I was to browse to "Our Mission" I would want the URL to read www.site.com/about-us/our-mission. Reading the URL, it then becomes obvious where I am in the sites page structure, almost like a breadcrumb trail.

I understand I could simply have an "about-us" controller, but this wouldn't be dynamic as I want all "pages" to route through one master "page" controller, be they "about us" or "contact us" or otherwise, as displaying one web-pages content should be handled by one controller.

Where this is confusing me is that I can't use a standard method as I will have an unknown amount of URI segments being passed to a given function, so I need to manually grab the URI segments and try to find a match in the database and work my way back through valid pages.

Using another example, I would also want www.site.com/about-us/not-a-real-page to detect that while "not-a-real-page" doesn't exist, "about-us" does and redirect them to the existing page.

Whilst I'm writing this, I guess I'm probably over-thinking this somewhat. I could set the standard master controller as the default controller so all web-pages get routed through there first of all. All I would really need to do is prevent the user from creating "pages" with reserved real controller names? So where I might have a controller accessed like: www.site.com/user/3, I would need to prevent the users from creating a page called "user" so there is no ambiguity when trying to decide whether this is a controller or a page to be called from the default master "page" controller.

Have I made things any clearer?

I had a quick look through the user guide for any reference to this "__call()" feature, and can't find anything on the subject, can you shed any light on that?

Regards,

Andy


Messages In This Thread
Help with full "fake" directory structure URL - by El Forum - 09-23-2009, 02:53 PM
Help with full "fake" directory structure URL - by El Forum - 09-23-2009, 03:17 PM
Help with full "fake" directory structure URL - by El Forum - 09-23-2009, 04:32 PM
Help with full "fake" directory structure URL - by El Forum - 09-23-2009, 04:49 PM
Help with full "fake" directory structure URL - by El Forum - 09-23-2009, 05:07 PM
Help with full "fake" directory structure URL - by El Forum - 09-23-2009, 05:15 PM
Help with full "fake" directory structure URL - by El Forum - 09-23-2009, 05:17 PM
Help with full "fake" directory structure URL - by El Forum - 09-23-2009, 09:41 PM



Theme © iAndrew 2016 - Forum software by © MyBB