0

Not sure if it is possible with ZF 1.11 to do the following

Normal method of displaying a photo

www.mysite.com/photos/display/377486

Where 377486 is the id of a photo within mysql and can be any integer

Is it possible to have the url shortened so I get the same with

www.mysite.com/photos/377486

If this is possible what is this technique/method called?

Many thanks

1 Answer 1

1

No, You need 2 different route.

You can test :

routes.photos.type = "Zend_Controller_Router_Route_Regex"
routes.photos.route = "photos/display/(\d+)"
routes.photos.defaults.controller = "photos"
routes.photos.defaults.action = "display"
routes.photos.map.1 = "id"
routes.photos.reverse = "books/%d"


routes.photos_short.type = "Zend_Controller_Router_Route_Regex"
routes.photos_short.route = "photos/(\d+)"
routes.photos_short.defaults.controller = routes.photos.defaults.controller
routes.photos_short.defaults.action = routes.photos.defaults.action
routes.photos_short.map.1 = "id"
routes.photos_short.reverse = "books/%d"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.