Url Structure for site |
[eluser]Unknown[/eluser]
I am looking to create a simple site, nothing fancy. All I am trying to do is be able to have a number of top level links: - Home - About - Contact - Links page And one or two pages a second level (and in the future a third): - Home - About -- About Aspect -- About Design - Contact -Links Page -- Fav links -- Design links How am I able to create a cms which can allow the following link structures, ie. a number of top level pages and a number of lower level pages with a clean URL. (example.com/about; example.com/about/aspect; example.com/contact) If there are any good resources anyone could share on this topic I would really appreciate it.
[eluser]clip[/eluser]
Two levels can be handled quite easily. You would have four controllers, Home, About, Contact, Links. For your About controller your methods would act as your second level. For example you would have a method called "aspect" and "design" in your controller. More levels would get trickier but could be handled with Routes.
[eluser]Unknown[/eluser]
Would it be possible to have these pages under one controller?
[eluser]WanWizard[/eluser]
Everything is possible, that's the fun of programming... ![]() You will have to process further URI segments manually. Assuming the URL is http://www.example.org/page/show/this/page, you could this in the page controller: Code: function show() Off course, you could automate this to a large extend if you give your views logical names, for example page_show_this_page.php. Then you can catch all requests using the _remap() method, assemble the view name from the URI segments, check if the view exists, and load it if it does: Code: $view = str_replace('/', '_', substr($this->ruri_string, 1)); |
Welcome Guest, Not a member yet? Register Sign In |