views:

24

answers:

1

Hi all,

I think this is a routing question.

For SEO reasons, I need urls like the following:

www.domain.com/acme-pump.html www.domain.com/beta-pump.html www.domain.com/boyden-pump.html ...

and also:

www.domain.com/acme-pumps.html www.domain.com/beta-pumps.html www.domain.com/boyden-pumps.html

(Note the "s" on pumps).

There are about a thousand brand names like acme, beta and boyden. I need the "acme", "beta", "boyden" parts of the urls to come out of a database - the "-pump" or "-pumps" part can be hard coded.

Obviously, I can't create a separate module for each of the brands.

I keep thinking that is a routing problem, but nothing I've tried in routing.yml works. Maybe I've got the wrong idea?

Any clues would be gratefully received.

Thanks,

John

A: 
## All your normal routing rules first.

product:              { url: /:slug, params: { module: Whatever, action: whatever } }

Then look up from the DB with something like:

$product = Doctrine::getTable('Product')->findOneBySlug($request->getParameter('slug'));
Coronatus