PHP Classes

PHP Module Loader v2: Load classes that add modular functionality

Recommend this page to a friend!
     
  Info   Example   View files Files   Install with Composer Install with Composer   Download Download   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
Not enough user ratingsTotal: 143 All time: 9,177 This week: 38Up
Version License PHP version Categories
module-loader2 2.0BSD License5.0PHP 5, Language
Description 

Author

This class can load classes that add modular functionality.

It can load a module that is a class that implements additional functionality by calling or accessing an array class variable.

The class can also list the loaded modules and unload loaded modules.

Picture of Nick Daniels
  Performance   Level  
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

 

Example

<?php

require_once 'lib/Autoloader.php';

spl_autoload_register('Autoloader::load');

$mod = new Modules;

print_r($mod->modules);

$mod->loadModule('Defaults');

$mod->modules['Defaults']->test();

$mod->unloadModule('Defaults');

print_r($mod->modules);


  Files folder image Files (4)  
File Role Description
Files folder imagelib (1 file, 1 directory)
Files folder imagemodules (1 directory)
Accessible without login Plain text file example.php Example Example File

The PHP Classes site has supported package installation using the Composer tool since 2013, as you may verify by reading this instructions page.
Install with Composer Install with Composer
 Version Control Unique User Downloads Download Rankings  
 0%
Total:143
This week:0
All time:9,177
This week:38Up