mattandrews / fruitmachine
A PHP port of @FTLabs's FruitMachine
Installs: 6 292
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 3
Forks: 0
Open Issues: 2
Requires
- mattandrews/model: ~0.0.10
Requires (Dev)
- phpmd/phpmd: 1.4.*
- phpunit/php-code-coverage: >=1.2.10,<1.3.0
- phpunit/phpunit: 3.7.*
README
PHP port of @FTLabs' fruitmachine, a lightweight component layout engine for client and server.
FruitMachine is designed to build rich interactive layouts from modular, reusable components. It's light and unopinionated so that it can be applied to almost any layout problem. FruitMachine is currently powering the FT Web App.
// Define a module class Apple extends \FruitMachine\AbstractModule { public static $name = 'apple'; public function template() { return 'hello' } } $fm = \FruitMachine\Singleton::getInstance(); // Define a module $fm->define('\Apple'); // Create a module $apple = $fm->create('apple'); // Render it echo $apple->toHTML(); //=> <div class="apple">hello</div>
Installation
To install from packagist either add mattandrews/fruitmachine
to your project's composer.json
file or enter the following on the command line:-
composer require mattandrews/fruitmachine
Compatability
Unit tests are run on each build against PHP 5.3, 5.4 and 5.5.
Author
- Matt Andrews - @matthew-andrews
Credits and collaboration
The lead developer of FruitMachine-php is Matt Andrews at FT Labs. All open source code released by FT Labs is licenced under the MIT licence. We welcome comments, feedback and suggestions. Please feel free to raise an issue or pull request.