views:

141

answers:

2

by default it seems my ZF is separating multiple parameter words with plus signs.

eg. /product/test+product+name

I would like to use -> /product/test-product-name

Here is the line from routes.ini

routes.product.route = "product/:productName"<br />
routes.product.defaults.controller = product<br />
routes.product.defaults.action = product 

What can do I do to fix this?

A: 

Well, as the + sign is commonly known to browsers to separate words, I don't thing Zend has provided an option, an most likely just uses +s because it is correct.

You might have to edit the source.

You may want to look at the Regex Routing here. It seems like it might be useful.

Chacha102
+1  A: 

This happens because the URLs are urlencoded to ensure document validity. You'll need to filter/replace the terms (productName) before generating routes. A simple str_replace should be all that you need. In my app, I filter excess whitespace and then replace spaces with dashes.

David Caunt