Welcome Guest, Not a member yet? Register   Sign In
Routing, url to page navigation
#1

[eluser]pieter dekker[/eluser]
I've a routing question.

Say I have a navigation structure on my website like this:

-products
->tshirts
->sweaters
-portfolio
->example1
->example2
-contact
->form
->email

I would like to have the following url structure, for example http://www.mywebsite.com/index.php/products/tshirts or http://www.mywebsite.com/index.php/portfolio/example1

The content is dynamically loaded from the database, new pages can be added, or pages can be deleted (sort of a cms). So I need to dynamically route the url to the right content. How can this be done?
#2

[eluser]Sumon[/eluser]
I think, you need number of controllers like products, portfolio etc..etc.

Product, portfolio or contact all mean different. So isn't it wise to create different controller's? Furthermore, products(or you can consider sub category) under categories can be dynamically added. For example tshirts and sweaters are items under Product category.
I might not reply as you expect. if it is, then sorry man.
#3

[eluser]pieter dekker[/eluser]
Sorry, can't do much with your answer.

Because it is a cms like system. Admin can log in on the website. He can add/delete pages. Therefor I only have 1 main controller. According to the input, the contents of a certain page will be viewed (stored in database).

Therefor I need to do something with routing, but I can't figure out, how.
#4

[eluser]Yash[/eluser]
dude just try to read [url="http://ellislab.com/codeigniter/user-guide/"]user guide[/url]

Just try with simple website I mean use views later use models for database like thing.To understand my ans please read user guide.
#5

[eluser]pieter dekker[/eluser]
I allready read the user-guide, but couldn't do much with routing these things.

But I found the answer with this post: http://ellislab.com/forums/viewthread/85290/

Tnx anyway!




Theme © iAndrew 2016 - Forum software by © MyBB