PHPackages                             jasonroyle/li3\_element - 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. jasonroyle/li3\_element

ActiveLithium-library[Utility &amp; Helpers](/categories/utility)

jasonroyle/li3\_element
=======================

Element helper for Lithium

0.2.1(11y ago)115MITPHPPHP &gt;=5.4.0

Since Feb 18Pushed 11y ago2 watchersCompare

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

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

Element Helper for Lithium
==========================

[](#element-helper-for-lithium)

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

[](#installation)

### Composer

[](#composer)

```
composer require jasonroyle/li3_element

```

### Git

[](#git)

```
git submodule add https://github.com/jasonroyle/li3_element.git libraries/li3_element

```

Enable the Library
------------------

[](#enable-the-library)

Make the application aware of the library by adding the following to `app/config/bootstrap/libraries.php`.

```
Libraries::add('li3_element');
```

Render
------

[](#render)

Renders an element.

### Params

[](#params)

- `$element` (string)
- `$data` (array, optional)

### Return

[](#return)

Rendered HTML (string)

Grid
----

[](#grid)

Iterates through items and renders an element per item. The elements are wrapped in row and column divs and returned as a rendered HTML string.

### Params

[](#params-1)

- `$element` (string)
- `$data` (array)
- `$options` (array, optional)

### Return

[](#return-1)

Rendered HTML (string)

### Examples

[](#examples)

By default the first value of the data array will be used as the items of which to iterate through.

The following example iterates through posts, replaces the post value of the data array with the individual post and passes the data on to the element to render.

```
echo $this->element->grid('post', ['post' => $posts]);
```

To pass more data to each of the elements simply append the data array.

```
echo $this->element->grid('post', [
	'post' => $posts,
	'foo' => $foo,
	'bar' => $bar
]);
```

Set `columns`, `offset` and `max` options to control how the items are displayed.

The following example renders 3 posts per row, ignores the first 2 posts and limits the amount of displayed posts to 9.

```
echo $this->element->grid('post', ['post' => $posts], [
	'columns' => 3,
	'offset' => 2,
	'max' => 9
]);
```

Appling attributes to rows and columns.

The following example applies the `class="row"` attribute to each row and the `class="column"` attribute to each column.

```
echo $this->element->grid('post', ['post' => $posts], [
	'columns' => 5,
	'row' => ['class' => 'row'],
	'column' => ['class' => 'column']
]);
```

The following example renders the same as the last except the attribute `class="column first"` is applied to every first column of each row and the attribute `class="column last"` is applied to every last column of each row.

```
echo $this->element->grid('post', ['post' => $posts], [
	'columns' => 5,
	'row' => ['class' => 'row'],
	'column' => ['class' => 'column'],
	'first_column' => ['class' => 'column first'],
	'last_column' => ['class' => 'column last']
]);
```

The following example renders the same as the last except the last row contains only one column. The attribute `class="column first last"` is applied to this column.

```
echo $this->element->grid('post', ['post' => $posts], [
	'columns' => 5,
	'max' => 11,
	'row' => ['class' => 'row'],
	'column' => ['class' => 'column'],
	'first_column' => ['class' => 'column first'],
	'last_column' => ['class' => 'column last'],
	'first_and_last_column' => ['class' => 'column first last']
]);
```

###  Health Score

23

—

LowBetter than 27% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity7

Limited adoption so far

Community4

Small or concentrated contributor base

Maturity50

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

Total

2

Last Release

4086d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/64b3c78db28fb95fbb5efd49d1fba515113af69f602a3de6f22f08a96641d9fe?d=identicon)[jasonroyle](/maintainers/jasonroyle)

### Embed Badge

![Health badge](/badges/jasonroyle-li3-element/health.svg)

```
[![Health](https://phpackages.com/badges/jasonroyle-li3-element/health.svg)](https://phpackages.com/packages/jasonroyle-li3-element)
```

###  Alternatives

[rainlab/blog-plugin

Blog plugin for October CMS

17257.7k](/packages/rainlab-blog-plugin)[rainlab/builder-plugin

Builder plugin for October CMS

17147.2k1](/packages/rainlab-builder-plugin)[pfefferle/wordpress-activitypub

The ActivityPub protocol is a decentralized social networking protocol based upon the ActivityStreams 2.0 data format.

5671.4k1](/packages/pfefferle-wordpress-activitypub)[civicrm/civicrm-drupal-8

Open source constituent relationship management for non-profits, NGOs and advocacy organizations.

18238.1k2](/packages/civicrm-civicrm-drupal-8)[mediawiki/semantic-glossary

A terminology markup extension with a Semantic MediaWiki back-end

1352.4k](/packages/mediawiki-semantic-glossary)[humanmade/lottie-lite

A lightweight Lottie Animations Extension for WordPress

374.3k](/packages/humanmade-lottie-lite)

PHPackages © 2026

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