PHP Classes

Add Module PHP Trait: Trait to add pluggable modules to classes

Recommend this page to a friend!
  Info   View files Example   View files View files (2)   DownloadInstall with Composer Download .zip   Reputation   Support forum   Blog    
Ratings Unique User Downloads Download Rankings
StarStarStarStar 64%Total: 309 All time: 7,302 This week: 66Up
Version License PHP version Categories
add-module-trait 1.1Public Domain5.4PHP 5, Language, Traits


This package provides a trait to add pluggable modules to classes.

The trait can register one or more modules by name that the container classes can call when necessary to implement functionality provided by the external modules.

Multiple registered modules can be called by name all at once or using generators to call each registered module one by one iterating over all the modules.

Innovation Award
PHP Programming Innovation award nominee
June 2015
Number 2

Prize: One downloadable e-book of choice by O'Reilly
Many packages can be extended using plugin modules.

This package implements a modular plugin functionality using a trait, so you can add plugin module support to any package without having to alter the package too much.

Manuel Lemos
Picture of Matthew Knowlton
  Performance   Level  
Name: Matthew Knowlton is available for providing paid consulting. Contact Matthew Knowlton .
Classes: 6 packages by
Country: United States United States
Age: 28
All time rank: 2038291 in United States United States
Week rank: 456 Up48 in United States United States Up
Innovation award
Innovation award
Nominee: 4x

Winner: 1x

  Files folder image Files  
File Role Description
Plain text file addModule.trait.php Class Trait Source
Accessible without login Plain text file addModule.example.php Example Example Class Implementing addModule

 Version Control Reuses Unique User Downloads Download Rankings  
This week:0
All time:7,302
This week:66Up
 User Ratings  
 All time