user319198
user319198

Reputation:

routing in zend framework

can anyone tell me when it is better to use routing in zend framework?

Upvotes: 1

Views: 274

Answers (2)

Darryl E. Clarke
Darryl E. Clarke

Reputation: 7637

All Zend Framework web applications use 'routing.' Even at it's most basic, default setup.

You don't really have much choice as to whether or not to use routing. You do have a choice as to how the routing is constructed and how your URLs will look.

Is it better to use custom routing to have "pretty" URLs? It's an opinion, but I say yes. Custom routes can change ugly things like this:

http://yoursite.com/Users/index/view/id/199

to something 'pretty' like this:

http://yoursite/user/joe

Getting into details as to how to do this can be found in many, many other questions here. Just search for Zend Framework Routing.

Upvotes: 2

Fge
Fge

Reputation: 2961

Routing can be seen as 'mapping the url to an action of your program'. So as soon as you can specifiy rules how you want urls to be mapped to your programmc-code, you can use routers.
If you use the FrontController you already do use routing (with the default-route at least) as they routers do tell the dispatcher what part of your program to call (they map the url to an module/controller/action).

This is of course very general, for any further answer you might have to go into details ;)

Upvotes: 1

Related Questions