• 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[routing] The use with a CMS

#1
[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









#2
[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?

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


Digg   Delicious   Reddit   Facebook   Twitter   StumbleUpon  


  Theme © 2014 iAndrew  
Powered By MyBB, © 2002-2020 MyBB Group.