PHPackages                             regulus/elemental - 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. regulus/elemental

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

regulus/elemental
=================

An HTML element building composer package for Laravel 5 that simplifies creation of active, selected, or hidden elements.

v0.5.6(8y ago)24.3k1MITPHPPHP &gt;=7.0.0

Since Jul 26Pushed 8y ago1 watchersCompare

[ Source](https://github.com/Regulus343/Elemental)[ Packagist](https://packagist.org/packages/regulus/elemental)[ RSS](/packages/regulus-elemental/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (2)Versions (11)Used By (1)

Elemental
=========

[](#elemental)

**An HTML element building composer package for Laravel 5 that simplifies creation of active, selected, or hidden elements.**

> **Note:** For Laravel 4, you may use [version 0.3.3](https://github.com/Regulus343/Elemental/tree/v0.3.3).

Elemental is a simple HTML element creation library, primarily for creating dynamic elements (such as "active", "selected", or "hidden" classed elements that depend on a certain variable as their trigger).

Elemental removes the need for you do to things like this in your markup:

```

	...

```

- [Installation](#installation)
- [Creating Dynamic Elements](#creating-dynamic-elements)
- [Creating Tables from Complex Arrays](#creating-tables)

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

[](#installation)

To install Elemental, make sure `regulus/elemental` has been added to Laravel 5's `composer.json` file.

```
"require": {
	"regulus/elemental": "0.5.*"
},

```

Then run `php composer.phar update` from the command line. Composer will install the Elemental package. Now, all you have to do is register the service provider and set up Elemental's alias in `config/app.php`. Add this to the `providers` array:

```
Regulus\Elemental\ElementalServiceProvider::class,

```

And add this to the `aliases` array:

```
'HTML' => Regulus\Elemental\Facade::class,

```

You may use 'Elemental', or another alias, but 'HTML' is recommended for the sake of simplicity. Elemental is now ready to go.

Creating Dynamic Elements
-------------------------

[](#creating-dynamic-elements)

**Creating a dynamic element that may have a "hidden" class:**

```
//create opening tag entirely with Elemental
echo HTML::openHiddenArea('div', ['id' => 'side-content', 'class' => 'content'], isset($sideContentHidden));

{{-- set the hidden class depending on a boolean value within the opening tag --}}
