承接 slender/module-loader 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

slender/module-loader

最新稳定版本:0.0.1

Composer 安装命令:

composer require slender/module-loader

包简介

Simple, de-coupled application modules

README 文档

README

Packagist.org Package Latest Stable Version License

Build Status Coverage Status

Simple Module loading for decoupled application components

Installation

Install via composer:

composer require slender/module-loader

Usage

<?php
    
use \Slender\ModuleLoader\ModuleLoader;
use \Slender\ModuleLoader\ModuleInterface;


$app = new \Slim\App();

/**
 * An example module class
 */
class MyModule implements ModuleInterface
{
	public function invokeModule( \Slim\App $slim )
	{
		$slim->get('/foo',function(){
			/* ... */
		});
	}
}

// Create the module loader instance
$moduleManager = new SimpleModuleLoader();

// Try to load the module
$moduleManager->loadModule('\Acme\Example\MyModule', $slim);

Module Locators

Module Locators are responsible for translating a module identifier string into a callable object that can be invoked to load the module. Module Locators must implement Slender\ModuleLoader\ModuleLocatorInterface

ModuleManager includes two default Locators, which are loaded by default when using the SimpleModuleLoader.

Slender Module Locator

Slender\ModuleLoader\Locator\SlenderModuleLocator This locator will use the module identifier as a fully-qualified class name and attempt to load the class as long as it implements Slender\ModuleLoader\ModuleInterface.

Invokable Class Locator

Slender\ModuleLoader\Locator\InvokableClassModuleLocator This locator will use the module identifier as a fully-qualified class name and attempt to load the class and then invoke it.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-12-13