Zend framework (1.7.5): how to change controller directory

前端 未结 2 1047
后悔当初
后悔当初 2021-01-20 00:58

Using Zend Framework I want to use controllers stored in a directory which is not default.

What I\'m trying to achieve is that if the requested path begins with admi

相关标签:
2条回答
  • 2021-01-20 01:05

    You could use the module directory structure. Create the directory structure

    application
      default
        controllers
        views
        models
      admin
        controllers
        views
        models
    

    For more info check out the docs on Using a Conventional Modular Directory Structure

    0 讨论(0)
  • 2021-01-20 01:16
    $front = Zend_Controller_Front::getInstance();
    $front->setControllerDirectory(...path...);
    

    OR multiple paths

    $front = Zend_Controller_Front::getInstance();
    $front->setControllerDirectory(array(
        'default' => '/path/to/application/controllers',
        'blog'    => '/path/to/application/blog/controllers'
    ));
    

    http://framework.zend.com/manual/en/zend.controller.front.html

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