简体   繁体   中英

Zend Framework URL to action in specifiic module

I have 2 modules: "Mobilewebapp" and "Backoffice". My default module is "Mobilewebapp". I have a layout "backoffice.phtml" for my backoffice. In there I have the following:

<a href="<?php echo $this->url(array('controller' => 'user', 'action' => 'logout'), null, true) ?>">Logout</a>

The problem is that the links always goes to the default module "mobilewebapp". I already tried this but still the same:

<a href="<?php echo $this->url(array('module' => 'backoffice', 'controller' => 'user', 'action' => 'logout'), null, true) ?>">Logout</a>

My application.ini:

[production]
phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
includePaths.library = APPLICATION_PATH "/../library"
bootstrap.path = APPLICATION_PATH "/Bootstrap.php"
bootstrap.class = "Bootstrap"
appnamespace = "Application"
resources.frontController.controllerDirectory = APPLICATION_PATH "/controllers"
resources.frontController.params.displayExceptions = 1
resources.layout.layoutPath = APPLICATION_PATH "/layouts/scripts/"

resources.frontController.moduleDirectory = APPLICATION_PATH
"/modules" resource.modules[] = ""
resources.frontController.params.prefixDefaultModule = "1"
resources.frontController.defaultModule = "mobilewebapp"

[staging : production]

[testing : production] phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1

[development : production] phpSettings.display_startup_errors = 1
phpSettings.display_errors = 1
resources.frontController.params.displayExceptions = 1

Did you try this

url(array('module' => 'backoffice', 'controller' => 'user', 'action' => 'logout')) ?>">Logout

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM