2009年5月6日星期三

Re: [fw-core] Url rewriting

Try something like this:


$frontController->getRouter()->addRoute('home', new Zend_Controller_Router_Route(
    ':value',
    array(
        'controller' => 'some',
        'action'     => 'index'
    )
));


and you can recovery the value in your controller using $request->getParam('value');


See more in: http://framework.zend.com/manual/en/zend.controller.router.html#zend.controller.router.default-routes
 

Diego Henrique
E-mail: diegoholiveira@yahoo.com.br
Cel: (31) 8415 4732
Website: http://www.diegoholiveira.com






From: -cab <sifr_2004@yahoo.it>
To: fw-core@lists.zend.com
Sent: Wednesday, May 6, 2009 4:14:36 PM
Subject: [fw-core] Url rewriting


Hello,

the indexAction of someController takes one parameter passed from the URL
and uses it to fetch a row in a database.
The value of the "name" column of this row should be used for url rewriting.

What i want is basically to convert "mysite.com/some/index/1" to
"mysite.com/namevalue".

How should i do this? Do i need to write my own router? I couldn't figure it
out by reading the zend router documentation page.

Any help would be greatly appreciated.
Thanks!
--
View this message in context: http://www.nabble.com/Url-rewriting-tp23413522p23413522.html
Sent from the Zend Core mailing list archive at Nabble.com.


没有评论: