Jan Pieper wrote:
Okay, my mistake but your solution allows something like /index/123 (if :article
is the article_id). I want that /, /index and /index/index use ArticleController
with indexAction. If no article_id is given, the application will show the
newest article.
The actual problem is, that I don´t see a solution how to use
ArticleController::indexAction() at /, /index and /index/index without adding
one entry per route (= 3 routes with the same target). I think this will work,
but I don´t think that this is an clean solution.
name=index {
module: null
controller: article
action: index
param1: default
param2: default
route: :param1/:param2
}
If you want only 'index' strings as params, you have to set requirements
(third constructor param to route instances) as 'index'.
Or you can directly use a regex route instead:
new ZCR_Route_Regex(
'(index(/index)?)?'
array('controller' => 'article', 'action' => 'index')
);
--
Michał Minicki aka Martel Valgoerad | [EMAIL PROTECTED] |
http://aie.pl/martel.asc
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
"Idleness is not doing nothing. Idleness is being free to do anything." --
Floyd Dell