PHPackages                             elife/patterns - 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. elife/patterns

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

elife/patterns
==============

eLife patterns

113.2k5[12 PRs](https://github.com/elifesciences/patterns-php/pulls)PHPCI failing

Since Oct 12Pushed 1mo ago8 watchersCompare

[ Source](https://github.com/elifesciences/patterns-php)[ Packagist](https://packagist.org/packages/elife/patterns)[ RSS](/packages/elife-patterns/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependenciesVersions (88)Used By (0)

eLife Patterns
==============

[](#elife-patterns)

[![Build Status](https://camo.githubusercontent.com/afd9a9e6a4eedc033885b9edc721351a10548f48f37f72bbae68e4a39e9d810b/687474703a2f2f63692d2d616c667265642e656c696665736369656e6365732e6f72672f6275696c645374617475732f69636f6e3f6a6f623d6c6962726172792d7061747465726e732d706870)](http://ci--alfred.elifesciences.org/job/library-patterns-php/)

PHP wrapper for eLife pattern library. The pattern library lives in `./patterns`.

Development workflow
--------------------

[](#development-workflow)

- Make changes in the `./patterns`, use local Makefile to make process easier.
- Use top level Makefile to update php wrapper.
    - `make update-local-patterns`
    - `make update-patterns` Deprecated target, that was used when patterns where developed in a separate repository.
- Use top level Makefile to assist php development.

Dependencies
------------

[](#dependencies)

- [Composer](https://getcomposer.org/)
- PHP 7

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

[](#installation)

Execute `composer require elife/patterns:dev-master`.

Running Tests
-------------

[](#running-tests)

To run all tests:

```
make test

```

To run one test:

```
vendor/bin/phpunit tests/src/ViewModel/ArticleSectionTest.php

```

Versioning
----------

[](#versioning)

This library is *not* versioned as the eLife Patterns can make breaking changes at any time. It's not expected to be used by libraries, but by applications where Composer lock files are used. These tie the application to a specific commit.

Usage
-----

[](#usage)

Create `ViewModel`s and pass them to a `PatternRenderer`, which will return the rendered template.

For example:

```
use eLife\Patterns\PatternRenderer\MustachePatternRenderer;

$helpers = [
    'assetsPath' => '/path/to/assets',
    'assetRewrite' => function (string $path, Mustache_LambdaHelper $helper) : string {
        return $helper->render($path).'?cache-buster';
    },
];

$mustache = new Mustache_Engine([
    'helpers' => $helpers,
    'loader' => new Mustache_Loader_FilesystemLoader('/path/to/patterns-php'),
]);
$patternRenderer = new MustachePatternRenderer($mustache);

var_dump($patternRenderer->render($viewModel));
```

Updating the library
--------------------

[](#updating-the-library)

1. Install [Docker](https://www.docker.com/).
2. Execute `bin/update` to update the `resources` folder from Pattern Lab (you can pass a commit or pull request if needed, eg `bin/update 4303c0199112724bd5725537c7192828099018fb` or `bin/update pr-850`).
3. Make changes to the view models accordingly.

###  Health Score

42

—

FairBetter than 90% of packages

Maintenance59

Moderate activity, may be stable

Popularity28

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity50

Maturing project, gaining track record

 Bus Factor2

2 contributors hold 50%+ of commits

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.

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/375812?v=4)[Scott Aubrey](/maintainers/scottaubrey)[@scottaubrey](https://github.com/scottaubrey)

---

Top Contributors

[![elife-alfred-user](https://avatars.githubusercontent.com/u/19778045?v=4)](https://github.com/elife-alfred-user "elife-alfred-user (449 commits)")[![thewilkybarkid](https://avatars.githubusercontent.com/u/1784740?v=4)](https://github.com/thewilkybarkid "thewilkybarkid (201 commits)")[![davidcmoulton](https://avatars.githubusercontent.com/u/2893480?v=4)](https://github.com/davidcmoulton "davidcmoulton (92 commits)")[![LinaKind](https://avatars.githubusercontent.com/u/67826881?v=4)](https://github.com/LinaKind "LinaKind (86 commits)")[![nlisgo](https://avatars.githubusercontent.com/u/383397?v=4)](https://github.com/nlisgo "nlisgo (66 commits)")[![stephenwf](https://avatars.githubusercontent.com/u/8266711?v=4)](https://github.com/stephenwf "stephenwf (51 commits)")[![scottaubrey](https://avatars.githubusercontent.com/u/375812?v=4)](https://github.com/scottaubrey "scottaubrey (36 commits)")[![viktoria-mahmud](https://avatars.githubusercontent.com/u/111341278?v=4)](https://github.com/viktoria-mahmud "viktoria-mahmud (27 commits)")[![giorgiosironi](https://avatars.githubusercontent.com/u/160299?v=4)](https://github.com/giorgiosironi "giorgiosironi (21 commits)")[![discodavey](https://avatars.githubusercontent.com/u/745794?v=4)](https://github.com/discodavey "discodavey (20 commits)")[![erkannt](https://avatars.githubusercontent.com/u/19282025?v=4)](https://github.com/erkannt "erkannt (17 commits)")[![Cosmin-Daniel](https://avatars.githubusercontent.com/u/107858401?v=4)](https://github.com/Cosmin-Daniel "Cosmin-Daniel (10 commits)")[![smoqadam](https://avatars.githubusercontent.com/u/1223848?v=4)](https://github.com/smoqadam "smoqadam (7 commits)")[![soggy-mushroom](https://avatars.githubusercontent.com/u/74007089?v=4)](https://github.com/soggy-mushroom "soggy-mushroom (4 commits)")[![gnott](https://avatars.githubusercontent.com/u/1779115?v=4)](https://github.com/gnott "gnott (3 commits)")[![NuclearRedeye](https://avatars.githubusercontent.com/u/52923935?v=4)](https://github.com/NuclearRedeye "NuclearRedeye (1 commits)")[![lsh-0](https://avatars.githubusercontent.com/u/2142748?v=4)](https://github.com/lsh-0 "lsh-0 (1 commits)")

### Embed Badge

![Health badge](/badges/elife-patterns/health.svg)

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

###  Alternatives

[robholmes/term-extractor

Term Extractor - a PHP port of Topia's Term Extractor

185.5k](/packages/robholmes-term-extractor)

PHPackages © 2026

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