petrgrishin/yii-html-tag

创建HTML标签的构建器,采用面向对象的方法

1.0.0 2014-08-16 10:07 UTC

This package is not auto-updated.

Last update: 2024-09-14 16:13:32 UTC


README

创建HTML标签的构建器,采用面向对象的方法

安装

将依赖项添加到项目的 composer.json 文件中

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

使用示例

创建标签

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>