PHPackages                             mattandrews/fruitmachine - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Utility &amp; Helpers](/categories/utility)
4. /
5. mattandrews/fruitmachine

ActiveLibrary[Utility &amp; Helpers](/categories/utility)

mattandrews/fruitmachine
========================

A PHP port of @FTLabs's FruitMachine

v0.5.5(12y ago)06.3k[2 issues](https://github.com/matthew-andrews/fruitmachine-php/issues)MITPHP

Since Jun 30Pushed 12y ago1 watchersCompare

[ Source](https://github.com/matthew-andrews/fruitmachine-php)[ Packagist](https://packagist.org/packages/mattandrews/fruitmachine)[ RSS](/packages/mattandrews-fruitmachine/feed)WikiDiscussions master Synced 2mo ago

READMEChangelogDependencies (4)Versions (20)Used By (0)

FruitMachine-php [![Build Status](https://camo.githubusercontent.com/0ca46ccf40b9d0d051aaaaad1573a3a10393cb5c8b5d716927c7d7ed4d04ef67/68747470733a2f2f7472617669732d63692e6f72672f6d6174746865772d616e64726577732f66727569746d616368696e652d7068702e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/matthew-andrews/fruitmachine-php)
================================================================================================================================================================================================================================================================================================================================================

[](#fruitmachine-php-)

PHP port of [@FTLabs](//github.com/FTLabs)' [fruitmachine](//github.com/ftlabs/fruitmachine), a lightweight component layout engine for [client](//github.com/ftlabs/fruitmachine) 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](http://apps.ft.com/ftwebapp/).

```
// 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();
//=> hello
```

Installation
------------

[](#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
-------------

[](#compatability)

Unit tests are run on each build against PHP 5.3, 5.4 and 5.5.

Author
------

[](#author)

- **Matt Andrews** - [@matthew-andrews](http://github.com/matthew-andrews)

Credits and collaboration
-------------------------

[](#credits-and-collaboration)

The lead developer of FruitMachine-php is [Matt Andrews](http://github.com/matthew-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.

###  Health Score

30

—

LowBetter than 64% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity18

Limited adoption so far

Community10

Small or concentrated contributor base

Maturity62

Established project with proven stability

 Bus Factor1

Top contributor holds 96.6% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~16 days

Total

19

Last Release

4396d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/c7a6d9c7fbab0221ad0996a5eb1f151d9027ffd34236651c070c4acfd744f066?d=identicon)[matthew-andrews](/maintainers/matthew-andrews)

![](https://www.gravatar.com/avatar/a242df1a42947b0c48548944843f8b60d08def6c99530950c490ffdf0aa89073?d=identicon)[georgecrawford](/maintainers/georgecrawford)

---

Top Contributors

[![matthew-andrews](https://avatars.githubusercontent.com/u/825088?v=4)](https://github.com/matthew-andrews "matthew-andrews (115 commits)")[![georgecrawford](https://avatars.githubusercontent.com/u/84737?v=4)](https://github.com/georgecrawford "georgecrawford (4 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/mattandrews-fruitmachine/health.svg)

```
[![Health](https://phpackages.com/badges/mattandrews-fruitmachine/health.svg)](https://phpackages.com/packages/mattandrews-fruitmachine)
```

###  Alternatives

[happy-types/enumerable-type

Strongly typed implementation of enumerable type in PHP which helps us to write a safer more readable code.

4742.6k](/packages/happy-types-enumerable-type)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
