saeven/zf2-dynamic-modules 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

saeven/zf2-dynamic-modules

Composer 安装命令:

composer require saeven/zf2-dynamic-modules

包简介

Dynamic module loader for ZF2

README 文档

README

I needed a means to dynamically wire modules into ZF2. This overrides the ModuleManager to create a system where closure conditions can be used to modify the application config's module array.

Configuration is very simple, and is done in your application.config.php, not in your module config!

Installation

composer require saeven/zf2-dynamic-modules

application.config.php

return [

    'service_manager' => [
        'factories' => [
            'ModuleManager' => 'CirclicalModuleLoader\Service\Factory\ModuleManagerFactory',
        ],
    ],

    'modules_conditional' => [
        'SomeModule' => function(){ return true; }
    ],

    'modules' => [

        // usual modules

    ],

    'module_listener_options' => [
        'config_glob_paths' => [
            'config/autoload/{,*.}{global,local}.php',
        ],
        'module_paths' => [
            './module',
            './vendor',
        ],
    ],
];

The magic happens in the closure that accompanies the modules_conditional array. Your closure would return true or false based on environment conditions.

Todo - this was done to conditionally load modules based on route, and perhaps, based on database data.

统计信息

  • 总下载量: 25
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 2
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2015-10-16

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固