|
|||
|
hi
im novice to zend_framework. im little confused about placing some special parts of code.. i know what code should i place to controllers, i know what code should i place to models, but there is still code i have no idea where to place for example routing rules.. now im placing it to index.php - bootstrap. it is no problem, but i think the bootstrap is getting little messy. so where do u place these rules?? |
|
|||
|
Hi,
I place it into a config file. The rewrite router even has special support for it: PHP Code:
Code:
routes.archive.route = "archive/:year/*" routes.archive.defaults.controller = archive routes.archive.defaults.action = show routes.archive.defaults.year = 2000 routes.archive.reqs.year = "\d+" routes.news.type = "Zend_Controller_Router_Route_Static" routes.news.route = "news" routes.news.defaults.controller = "news" routes.news.defaults.action = "list" routes.archive.type = "Zend_Controller_Router_Route_Regex" routes.archive.route = "archive/(\d+)" routes.archive.defaults.controller = "archive" routes.archive.defaults.action = "show" routes.archive.map.1 = "year" ; OR: routes.archive.map.year = 1 |
![]() |
| Thread Tools | |
| Display Modes | |
|
|