phpzend-frameworkzend-framework-mvczend-router

Dynamic Controller with Zend Router through Resources


I'm trying to create a clone ( http://site.com/indexclone ) for http://site.com/index, but I also want all actions to be functional as they are in IndexController and potential parameters that are passed to original controller. I've figured out so far:

resources.router.routes.indexclone.route = "indexclone/:action"
resources.router.routes.indexclone.defaults.controller = "index"
resources.router.routes.indexclone.defaults.action = "index"

Please help me figure out the dynamic approach to the parameters list. Thank you in advance!


Solution

  • You can do this:

    resources.router.routes.indexclone.route = "indexclone/:action/*"
    resources.router.routes.indexclone.defaults.controller = "index"
    resources.router.routes.indexclone.defaults.action = "index"
    

    But if don't solve your problem you can use the bootstrap to create a dynamic router.