CodeIgniter Forums
[routing] The use with a CMS - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: [routing] The use with a CMS (/showthread.php?tid=47967)



[routing] The use with a CMS - El Forum - 12-30-2011

[eluser]douweegbertje[/eluser]
Hello,

I just started with CodeIgniter and its looking very good.
Yet I came to a problem while working on a CMS.
I want the data on the pages to be dynamical..

To give a brief explanation:

Based on "normal" pages with URI as in:

mywebsite.com/home
mywebsite.com/contact


Now taken from the helppage:

example.com/class/function/ID

so I used routing to solve this.

Code:
$route['(:any)'] = "pages/page/$1";

This way with a pages controller you can add the correct data for this page.
Yet what if you have page with

mywebsite.com/about-us/information
mywebsite.com/about-us/location


Should I be using this?:

Code:
$route['(:any)/(:any)'] = "pages/page/$2";
$route['(:any)/(:any)/(:any)'] = "pages/page/$3";


For some reason ive been very busy to understand the way the routing works.
Furthermore I dont see a way to deal with dynamic content, and having pages with static content as a "special module" designed for that page.
To explain:

If I had a registration form, specialy designed for that project. How would I place this into the CMS while having the routes designed for dynamic pages?

For now I have added a route for my admin part:

Code:
$route['admin/(:any)'] = "admin/$1";

but in the end, I feel like working the wrong way.

Any advice, tips and maybe some guide for me to improve my work?

Thanks











[routing] The use with a CMS - El Forum - 03-07-2012

[eluser]douweegbertje[/eluser]
Just a bump, since I have been busy on many other projects :o

I was wondering:

Is it actually smart to use a full url like "/information/contact" as query instead of what Im used to do: an ID.

On the "normal" way you kinda have this "/page/id" where you have stored the data on the ID.

Now with this, you would actually search your data in the database by using "/information/contact" right?


[routing] The use with a CMS - El Forum - 03-08-2012

[eluser]douweegbertje[/eluser]
anyone has an idea?