raphahardt/modularphp

This package is abandoned and no longer maintained. No replacement package was suggested.

AMD for PHP, like RequireJS or AngularJS

v0.1.0 2014-02-08 15:38 UTC

This package is not auto-updated.

Last update: 2021-09-16 14:37:39 UTC


README

Split your application logic in AMD (Asynchronous Module Definition), like RequireJS or AngularJS. This library is experimental and is not already fully tested. USE AT YOUR OWN RISK!

Usage

use Modular/Module;

Module::create('moduleA', array('moduleB'), function ($app) { // your application logic here });

Module::create('moduleB', function ($app) { // you can change the $app var here too and the changes applies to moduleA });

// select the initial module Module::bootstrap('moduleA', new \Application()); // your application object

License

This code is under MIT license.