php - Make friendly url in zend framework -
i have built site on zend-framework 1.9.7. want make friendly url every page has url similar : http://mysite/search/detail/id/124
i want friendly url like: http://mysite/search/detail/ram
where "ram" name of user has id=124
i have include rewriterule ^name/(.*)/$ guid/$1
in .htaccess file, doesn't work.
i suggest take @ zend controller quickstart walks through steps of setting standard routing (which provides nice urls).
if want more detailed info on routing, suggest take @ zend_controller_router's manual.
specifically handle case through router route, example:
<?php $router = zend_controller_front::getinstance()->getrouter(); $detailsroute = new zend_controller_router_route("search/detail/:name", array( 'controller' => 'search', 'action' => 'detail' )); $router->addroute('searchdetail', $detailsroute);
the part :name
parameter gets filled value ram
of desired url, , can retrieved $request->getparam('name');
later on.
Comments
Post a Comment