Welcome Guest, Not a member yet? Register   Sign In
URI Routing
#4

[eluser]jedd[/eluser]
Spam .. ignore him, and he'll go away.


[quote author="_mtr" date="1251099599"]
... http://www.example.com/manufacturers/honda/civic/1995

I would need a Manufacturers controller with a general manufacturer lookup function, correct?[/quote]

Well, maybe not quite. It's tricky, as this is a contrived example. If you have a site about vehicles of all sorts, you may then have a controller called car (and another one for trucks, one for planes, etc). Remember, contrived example! Wink

So your URL would start www.example.com/car/ ...

You'd have a browse and a search method, probably, and they might lead you to a method that would show you details for a car - which is kind of where you were heading above. But your URL might look more like this:

www.example.com/car/show/honda/civic/1995

I'd suggest that you don't want to play with routes.php if you can avoid it. And you can usually avoid it.

If you think of a controller as representing or managing a resource, things might be easier. Manufacturer is actually an attribute of a car, I'd say, so you are probably going to paint yourself into a corner if you stick with a controller called manufacturer.

You might have a controller elsewhere that you use to maintain your list of manufacturers - to add, rename, delete them - but that's not what you're doing in this instance.


Messages In This Thread
URI Routing - by El Forum - 08-23-2009, 08:39 PM
URI Routing - by El Forum - 08-24-2009, 02:46 PM
URI Routing - by El Forum - 08-24-2009, 06:55 PM
URI Routing - by El Forum - 08-24-2009, 07:26 PM
URI Routing - by El Forum - 08-24-2009, 07:37 PM
URI Routing - by El Forum - 08-24-2009, 07:50 PM
URI Routing - by El Forum - 08-24-2009, 07:58 PM
URI Routing - by El Forum - 08-25-2009, 05:20 AM



Theme © iAndrew 2016 - Forum software by © MyBB