2017 © Pedro Peláez
 

library module-loader

Simple, de-coupled application modules

image

slender/module-loader

Simple, de-coupled application modules

  • Saturday, December 13, 2014
  • by alanpich
  • Repository
  • 1 Watchers
  • 0 Stars
  • 7 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 2 Versions
  • 0 % Grown

The README.md

Slender Module Loader

Packagist.org Package Latest Stable Version License, (*1)

Build Status Coverage Status, (*2)


Simple Module loading for decoupled application components, (*3)


Installation

Install via composer:, (*4)

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, (*5)

ModuleManager includes two default Locators, which are loaded by default when using the SimpleModuleLoader., (*6)

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., (*7)

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., (*8)

The Versions

13/12 2014

dev-master

9999999-dev https://github.com/alanpich/Slender-ModuleLoader

Simple, de-coupled application modules

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Alan Pich

module loader slender

13/12 2014

0.0.1

0.0.1.0 https://github.com/alanpich/Slender-ModuleLoader

Simple, de-coupled application modules

  Sources   Download

MIT

The Requires

  • php >=5.4.0

 

The Development Requires

by Alan Pich

module loader slender