An HTML abstraction layer.

1.0.0 2018-02-04 11:58 UTC

This package is auto-updated.

Last update: 2022-06-08 20:57:45 UTC


Indigo HTML tries to simplify HTML element manipulation. It does not work with DOMElement but provides an API of its own. It also provides integration with Zend View in the form of view helpers.


composer require hipnaba/indigo-html dev-master


// Creating elements
$link = new \Indigo\Html\Element\Element('a', [
    'class' => 'link',

// Settings attributes
$link->setAttribute('href', '#');

// Working with css classes

// Setting content
$link->setContent('This is a link!');

// Nesting elements
$item = new \Indigo\Html\Element\Element('li');

$list = new \Indigo\Html\Element\Element('ul', [
    'id' => 'menu',

// Rendering elements using the helper
echo $this->htmlElement($list);

The above example would render something like this:

<ul id="menu">
        <a class="link link-default" href="#">This is a link!</a>