PHPackages                             taviroquai/mask - 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. taviroquai/mask

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

taviroquai/mask
===============

A PHP trait as a basic template engine

v1.0.0(11y ago)1141MITPHPPHP &gt;=5.3.4

Since Mar 19Pushed 11y ago1 watchersCompare

[ Source](https://github.com/taviroquai/mask)[ Packagist](https://packagist.org/packages/taviroquai/mask)[ RSS](/packages/taviroquai-mask/feed)WikiDiscussions master Synced today

READMEChangelog (1)DependenciesVersions (3)Used By (0)

mask
====

[](#mask)

Mask is a PHP trait that functions as a basic PHP template engine

Tutorial
--------

[](#tutorial)

**create a simple view to hold ALL view logic**

```
class MyView
{
    protected $title = 'Hello';
    protected function logic()
    {
        return 'World!';
    }
}
```

**add mask**

```
use Taviroquai\Mask\Mask;

class MyView
{
    use Mask;

    protected $title = 'Hello';
    protected function logic()
    {
        return 'World!';
    }
}
```

**now create an HTML file: template.html**

```

{{ title }}
{{ if logic }}{{ logic }}{{ endif }}

```

**finally use it in PHP as**

```
$view = new MyView;
echo $view->mask('template');
```

**output:**

```

Hello
World!

```

API
---

[](#api)

### Call variables and methods

[](#call-variables-and-methods)

{{ variableName }} {{ methodName }}

### Conditions

[](#conditions)

{{ if methodOrVariableName }} ... something ... {{ endif }}

### Foreach loops

[](#foreach-loops)

{{ for variable as local }}
{{ local }}
{{ endfor }}

### Includes

[](#includes)

**include partial.html**
{{ include partial }}

Options
-------

[](#options)

```
// Set cache path
Mask::$templateCachePath = './path/to/cache';

// Set templates path
Mask::$templatePath = './path/to/templates';

// Choose what properties to publish by overriding getMaskData()
class MyView
{
    use Mask;

    protected $property1;
    protected $property2;

    public function getMaskData()
    {
        return array(
            'property2' => 'override'
        );
    }
}
```

###  Health Score

26

—

LowBetter than 41% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity8

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% 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

Unknown

Total

1

Last Release

4126d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/498409?v=4)[Marco Afonso](/maintainers/taviroquai)[@taviroquai](https://github.com/taviroquai)

---

Top Contributors

[![taviroquai](https://avatars.githubusercontent.com/u/498409?v=4)](https://github.com/taviroquai "taviroquai (9 commits)")

### Embed Badge

![Health badge](/badges/taviroquai-mask/health.svg)

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

###  Alternatives

[limenius/react-bundle

Client and Server-side react rendering in a Symfony Bundle

3851.2M](/packages/limenius-react-bundle)[area17/laravel-auto-head-tags

Laravel Auto Head Tags helps you build the list of head elements for your app

4616.1k](/packages/area17-laravel-auto-head-tags)[ktquez/laravel-tinymce

TinyMCE editor for Laravel and Lumen Framework

2525.4k](/packages/ktquez-laravel-tinymce)[jelix/wikirenderer

WikiRenderer is a library to generate HTML or anything else from wiki content.

1712.3k1](/packages/jelix-wikirenderer)[webkinder/sproutset

A Composer package for handling responsive images in Roots Bedrock + Sage + Blade projects.

282.2k](/packages/webkinder-sproutset)

PHPackages © 2026

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