2012-02-23 80 views
2

我想路由/市場研究/到/索引/索引/幻燈片/ 2的Zend控制器路由器傳遞變量

所以,我想通過這個值2的「滑」參數

$routemr = new Zend_Controller_Router_Route_Static(
     'market-research', 
     array('controller' => 'index', 'action' => 'index') 
    ); 
    $router->addRoute('market-research', $routemr); 

我該怎麼做?謝謝。

回答

4

嘗試以下操作:

$router = $frontController->getRouter(); 
    $route = new Zend_Controller_Router_Route_Static(
      '/market-research', 
     array(
      'controller' => 'index', 
      'action'  => 'index', 
      'type' => 'slide', //default value (im using 'type' just as an example) 
      'id' => 2, //default value 

     )); 
    $router->addRoute('market-research', $route); 
0

這應做到:

$router = $this->_front->getRouter(); 
$route = new Zend_Controller_Router_Route(
    'market-research/', 
    array(
     'controller' => 'index', 
     'action' => 'index', 
     'slide' => 2 
    ) 
); 
$router->addRoute('index-marketresearch', $route); 
相關問題