petrgrishin/yii-html-tag

Builder to create a html tag, an object-oriented approach

1.0.0 2014-08-16 10:07 UTC

This package is not auto-updated.

Last update: 2024-12-21 17:27:41 UTC


README

Builder to create a html tag, an object-oriented approach

Installation

Add a dependency to your project's composer.json:

{
    "require": {
        "petrgrishin/yii-html-tag": "~1.0"
    }
}

Usage examples

Create tag

use \PetrGrishin\HtmlTag\HtmlTag;

$tag = HtmlTag::create(HtmlTag::TAG_DIV, array('class' => 'content'))->begin();
$tag->addClass('well');

print('content');

$tag->end();
// output: <div class="content well">content</div>