How do I write chains of chains of … of route in a ini file for the Zend framework?

前端 未结 1 766
谎友^
谎友^ 2021-02-10 18:56

I am trying to define routes as below with an INI file for the Zend Framework: http://api.example.com/servicename/{version}/users/:userid/items/:itemid

routes.ho         


        
1条回答
  •  名媛妹妹
    2021-02-10 19:32

    I think I have found how to do it. Basically, you define the parts of each routes with abstract set to true and link them all with routes whose type is set to Zend_Controller_Router_Route_Chain. Something like:

    [...]
    routes.users.type = "Zend_Controller_Router_Route"
    routes.users.route = "users"
    routes.users.abstract = "1"
    routes.users.defaults.controller = "users"
    routes.users.defaults.action = "index"
    
    routes.host-api-users.type = "Zend_Controller_Router_Route_Chain"
    routes.host-api-users.chains = "host, api, users"
    

    0 讨论(0)
提交回复
热议问题