|
|||
|
I use ZF 1.0 RC2
Right. I've been digging more, I created a Module Note, so when I type: http://myweb/note/archive/2007 I get all Notes from 2007. http://myweb/note/archive/2007-06 I get all Notes from June 2007 http://myweb/note/archive/2007-06-11 I get all Notes from 11 June 2007, finally http://myweb/note/archive/2007-06-11/1-someTitle.html I get the Note Content. For that, I created a Router like this: Code:
$route = new Zend_Controller_Router_Route_Regex(
'note/archive(?:/(\d+)(?:-(\d+)(?:-(\d+)(?:/(\d+)-(.+)html?)?)?)?)',
array(
'module' => 'note',
'controller' => 'archive',
'action' => 'view',
),
array(
1 => 'year',
2 => 'month',
3 => 'day',
4 => 'nid',
5 => 'title'
),
'note/archive/%d-%d-%d-%d-%s.html'
);
$router = new Zend_Controller_Router_Rewrite();
$router->addRoute('noteArchiveView', $route);
$frontController = Zend_Controller_Front::getInstance();
$frontController->addModuleDirectory('app/modules');
$frontController->throwExceptions(true);
$frontController->setRouter($router);
$frontController->dispatch();
Last edited by Tommy1402 : 06-16-2007 at 05:31 AM. |
![]() |
| Thread Tools | |
| Display Modes | |
|
|