PHPackages                             box/brainy - 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. [Templating &amp; Views](/categories/templating)
4. /
5. box/brainy

ActiveLibrary[Templating &amp; Views](/categories/templating)

box/brainy
==========

Brainy - A smart, parallel templating engine based on Smarty

4.0.0(3y ago)7015311[1 issues](https://github.com/box/brainy/issues)1LGPL-3.0PHPPHP &gt;=7.3

Since Jan 15Pushed 3y ago12 watchersCompare

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

READMEChangelog (10)Dependencies (3)Versions (26)Used By (1)

[![Build Status](https://camo.githubusercontent.com/fb2f830fce4717a25ef17cb8b72af0db4e1a94bbf51e3053d6f32c4f1f88faaa/68747470733a2f2f7472617669732d63692e6f72672f626f782f627261696e792e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/box/brainy)[![Latest Stable Version](https://camo.githubusercontent.com/a1aeb57b208c519e6ec9ac57be8cb9c41bb84a7cec2a22c7a76f52a6549c0221/68747470733a2f2f706f7365722e707567782e6f72672f626f782f627261696e792f762f737461626c65)](https://packagist.org/packages/box/brainy)[![Project Status](https://camo.githubusercontent.com/5b5a2250da48f45495a817a4bcdabb5d101fff298acebe00a55a52815b7119ed/687474703a2f2f6f70656e736f757263652e626f782e636f6d2f6261646765732f6163746976652e737667)](http://opensource.box.com/badges)[![Total Downloads](https://camo.githubusercontent.com/ac7680b41f17abe84adac38c402332a7c55e8d5dace02dfda9fbfe1ec9f020c8/68747470733a2f2f706f7365722e707567782e6f72672f626f782f627261696e792f646f776e6c6f616473)](https://packagist.org/packages/box/brainy)[![License](https://camo.githubusercontent.com/a79965fb5a516adbd19e10306beabf7706c7a4394ca05427cd140037615925b5/68747470733a2f2f706f7365722e707567782e6f72672f626f782f627261696e792f6c6963656e7365)](https://packagist.org/packages/box/brainy)

[![Brainy](logo.png "Brainy")](logo.png)

Brainy
======

[](#brainy)

Brainy is a replacement for the popular [Smarty](http://www.smarty.net/)templating language. It is a fork from the Smarty 3 trunk.

Brainy is still very new and it's likely that you will encounter some issues. Please report any problems that you encounter.

Why Brainy?
-----------

[](#why-brainy)

- Brainy generates clean and fast code by default.
- Brainy has security defaults that align better with [best practices](http://www.phptherightway.com/#security).
- Brainy does not include features that are infrequently used and increase code bloat.

Because Brainy is a fork of Smarty 3, it shares much of the same syntax and features while eliminating dangerous footguns and making it hard to write bad code.

Getting Started
---------------

[](#getting-started)

Check out the [Getting Started](https://github.com/box/brainy/wiki/Getting-Started)page on the wiki.

### Minimum Requirements

[](#minimum-requirements)

- PHP 7.3+
- `mbstring` PHP extension

The `mbstring` extension is required in order to properly support Unicode in templates and user-provided content. Brainy 3 cannot be run in a mode that does not handle Unicode properly.

Contributing to Brainy
----------------------

[](#contributing-to-brainy)

For information on how to set up a local dev environment and run the tests, see the wiki page on [Hacking on Brainy](https://github.com/box/brainy/wiki/Hacking-on-Brainy).

### Where is Brainy headed?

[](#where-is-brainy-headed)

See [the project roadmap](https://github.com/box/brainy/wiki/Roadmap)for information on upcoming releases.

### Requested Contributions

[](#requested-contributions)

If you're interested in helping out, pull requests for the following tasks will be warmly welcomed:

- Convert all non-public methods to use camel case.
- Add proper PHPDoc annotations to all functions and methods.
- Refactoring:
    - Eliminate dead code
    - `@` error suppression
    - Increase code coverage
    - etc.
- Help identify and resolve potential security issues, or find ways to help developers avoid security issues.
- Performance optimization of generated code

At the time of writing, the project has approximately 68% line coverage.

Support
-------

[](#support)

Need to contact us directly? Email  and be sure to include the name of this project in the subject.

Copyright and License
---------------------

[](#copyright-and-license)

Copyright 2014-2015 Box, Inc. All rights reserved.

Copyright 2002 – 2014 New Digital Group, Inc.

This library is licensed under the GNU Lesser Public License. A copy of the license should have [been provided](LICENSE.md).

###  Health Score

36

—

LowBetter than 82% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity25

Limited adoption so far

Community23

Small or concentrated contributor base

Maturity68

Established project with proven stability

 Bus Factor1

Top contributor holds 76.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 ~132 days

Recently: every ~594 days

Total

22

Last Release

1365d ago

Major Versions

1.0.0 → 2.0.02015-03-13

2.1.3.x-dev → 3.0.02015-12-16

3.2.1 → 4.0.02022-08-23

PHP version history (3 changes)1.0.0PHP &gt;=5.3

3.0.0PHP &gt;=5.4

4.0.0PHP &gt;=7.3

### Community

Maintainers

![](https://www.gravatar.com/avatar/0aca9ed1e01afe497144e68e5dfe1404cf2366a1cd6d67d1ea65c59e87d8c902?d=identicon)[mattbasta](/maintainers/mattbasta)

---

Top Contributors

[![mattbasta](https://avatars.githubusercontent.com/u/279498?v=4)](https://github.com/mattbasta "mattbasta (72 commits)")[![DavidSchnepper](https://avatars.githubusercontent.com/u/2092087?v=4)](https://github.com/DavidSchnepper "DavidSchnepper (12 commits)")[![vctrshn](https://avatars.githubusercontent.com/u/8610283?v=4)](https://github.com/vctrshn "vctrshn (7 commits)")[![chriseling](https://avatars.githubusercontent.com/u/2817755?v=4)](https://github.com/chriseling "chriseling (1 commits)")[![cvan](https://avatars.githubusercontent.com/u/203725?v=4)](https://github.com/cvan "cvan (1 commits)")[![nzakas](https://avatars.githubusercontent.com/u/38546?v=4)](https://github.com/nzakas "nzakas (1 commits)")

---

Tags

twigtemplatetemplatingmustachesmarty

###  Code Quality

TestsPHPUnit

Code StylePHP\_CodeSniffer

### Embed Badge

![Health badge](/badges/box-brainy/health.svg)

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

###  Alternatives

[mustache/mustache

A Mustache implementation in PHP.

3.3k44.6M291](/packages/mustache-mustache)[latte/latte

☕ Latte: the intuitive and fast template engine for those who want the most secure PHP sites. Introduces context-sensitive escaping.

1.3k15.7M683](/packages/latte-latte)[eftec/bladeone

The standalone version Blade Template Engine from Laravel in a single php file

8208.4M87](/packages/eftec-bladeone)[zordius/lightncandy

An extremely fast PHP implementation of handlebars ( http://handlebarsjs.com/ ) and mustache ( http://mustache.github.io/ ).

60910.5M45](/packages/zordius-lightncandy)[text/template

Simple and secure string-template-engine (Twig-like syntax) with nested if/elseif/else, loops, filters. Simple OOP api: Just one class doing the job (2-lines of code). Fast and secure: No code-generation, no eval'ed() code. Extensible by callbacks. Fully tested. Rich examples included.

38201.1k10](/packages/text-template)

PHPackages © 2026

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