2012-01-02 4 views
0

URL에 값을 저장하는 경로를 설정해야한다는 내용을 읽었습니다. 즉, application.ini 예는 zendframework 참조 가이드에서 보여 것 :Zend Paginator and Routes

routes.example.route = articles/:articleName/:page 
routes.example.defaults.controller = articles 
routes.example.defaults.action = view 
routes.example.defaults.page = 1 
routes.example.reqs.articleName = \w+ 
routes.example.reqs.page = \d+ 

가 어떻게 위의 설정으로 개체를 인스턴스화 내 부트 스트랩에서 사용할 수 있을까? 예 : I 냈

$route = new Zend_Controller_Router_Route(
        'product/:id', 
        array(
         'module' => 'default', 
         'controller' => 'product', 
         'action' => 'detail', 
        ), 

    ); 
    $router->addRoute('product', $route); 
+1

정말 페이징 작업자에게는이 구성이 필요하지 않습니다. 어쨌든 대답을 얻으려면보다 구체적이어야합니다. –

+0

@ aurelio-de-rosa 부트 스트랩에서 내 경로를 구성했지만 다른 장소에 경로를 삽입하는 것을 망치지 않습니다. – dextervip

답변

0

는 젠드 제어기 라우터 라우터에 의해 수신 된 상기 제 2 어레이의 PARAM 변수 요구된다.

$route = new Zend_Controller_Router_Route(
       'articles/:articleName/:page', 
       array(
        'module' => 'default', 
        'controller' => 'articles', 
        'action' => 'view', 
        'page' => 1 
       ), 
       array(
        'articleName' => '\w+', 
        'page' => '\d+'      
       ) 

); 
$router->addRoute('example', $route); 
+0

정확히 내 의견과 의미가 무엇입니까? –