PHPackages                             ropendev/platesattributes - 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. ropendev/platesattributes

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

ropendev/platesattributes
=========================

\[Plates Extension\] Transform an array in html tag attributes.

1.0.1(11y ago)4119MITPHPPHP &gt;=5.3.0

Since Dec 15Pushed 7y ago3 watchersCompare

[ Source](https://github.com/RobinDev/platesAttributes)[ Packagist](https://packagist.org/packages/ropendev/platesattributes)[ Docs](https://github.com/RobinDev/platesAttributes)[ RSS](/packages/ropendev-platesattributes/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (2)Versions (3)Used By (0)

This package is not maintened anymore (but still works) : Use

Plates Extension : Render html tag attributes
=============================================

[](#plates-extension--render-html-tag-attributes)

[![Quality Score](https://camo.githubusercontent.com/a5c9972ac56b0c6a687e14e997ade5e1f54263655feb3f9aaa7b5da98f9dcff9/68747470733a2f2f696d672e736869656c64732e696f2f7363727574696e697a65722f672f526f62696e4465762f706c61746573417474726962757465732e7376673f7374796c653d666c61742d737175617265)](https://scrutinizer-ci.com/g/RobinDev/platesAttributes)[![SensioLabsInsight](https://camo.githubusercontent.com/42c5ed10862327e1e09c7d2e49855fe7f09aefc7c140ed331d905d19311b6bf8/68747470733a2f2f696e73696768742e73656e73696f6c6162732e636f6d2f70726f6a656374732f33643236356532322d326330632d346335302d383236302d3636306365323464656461632f6d696e692e706e67)](https://insight.sensiolabs.com/projects/3d265e22-2c0c-4c50-8260-660ce24dedac)[![Build Status](https://camo.githubusercontent.com/8c9f1fffefc3c3ce8ae227c4abfae0aa14577de22a873c8f436983a11c595d24/68747470733a2f2f7472617669732d63692e6f72672f526f62696e4465762f706c61746573417474726962757465732e737667)](https://travis-ci.org/RobinDev/platesAttributes)

This package is an extension for the template engine [Plates](https://github.com/thephpleague/plates).

Two features for the same goal **Manipulate html tag attributes via PHP array** :

- `$this->attr(array $attributes)` transform an array in html tag attributes
- `$this->mergeAttr(array $arr1, array $arr2, [array $arr3, ...])` merge multiple array without loosing values (Eg. : `['class' => 'main']` + `['class' => 'content']` = `['class' => 'main content']`)

\##Table of contents

- [Usage](#usage)
- [Installation](#installation)
    - [Packagist](https://packagist.org/packages/ropendev/cache)
- [Requirements](#requirements)
- [Contributors](#contributors)
- [Licence](#licence)

\##Usage

```
/* Template Init */
$templateEngine = new \League\Plates\Engine('app/views');

/* Load this extension */
$templateEngine->loadExtension(new \rOpenDev\PlatesExtension\Attributes());

$this->render('test', ['attributes' => ['class' => 'content']]);
```

In your `app/views/test.php` template file:

```

>Hello World !
```

Will render:

```
Hello World !
```

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

[](#installation)

```
composer require ropendev/platesattributes
```

Requirements
------------

[](#requirements)

Stand alone extension.

See `composer.json` file.

Contributing
------------

[](#contributing)

See `CONTRIBUTING.md` file.

Contributors
------------

[](#contributors)

- Original author [Robin (UX Design)](http://www.robin-d.fr)
- ...

License
-------

[](#license)

MIT (see the LICENSE file for details)

###  Health Score

28

—

LowBetter than 54% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity14

Limited adoption so far

Community5

Small or concentrated contributor base

Maturity59

Maturing project, gaining track record

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 ~29 days

Total

2

Last Release

4143d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/afce4cf517928a50560237f1410d5957271fd808671b2216687ecf1422adaee0?d=identicon)[Robin D.](/maintainers/Robin%20D.)

---

Tags

templatetemplatingviewplates

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/ropendev-platesattributes/health.svg)

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

###  Alternatives

[eftec/bladeone

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

8208.4M87](/packages/eftec-bladeone)[laminas/laminas-view

Fast and type safe HTML templating library with a flexible plugin system supporting multistep template composition

7526.3M230](/packages/laminas-laminas-view)[eftec/bladeonehtml

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

1018.1k5](/packages/eftec-bladeonehtml)

PHPackages © 2026

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