umbrella/tag-builder 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

umbrella/tag-builder

Composer 安装命令:

composer require umbrella/tag-builder

包简介

TagBuilder is a component to help you to build html tags

README 文档

README

Build Status Scrutinizer Code Quality Code Coverage Latest Stable Version Downloads

SensioLabsInsight

What is it?

TagBuilder is a component to help you to build html tags. But why use it to render tags instead of just write them? Well the tag builder sets a pattern of how we need to handle html elements, this avoids html errors and copy and paste code.

Install

{
    "require": {
        "umbrella/tag-builder": "~1.0"
    }
}

Usage

Build a link tag.

  $linkTag = new \Umbrella\TagBuilder\TagBuilder('a');
  
  //Adds a href attribute to the tag
  $linkTag->mergeAttribute('href', '#');
  
  //Adds a css class to the tag
  $linkTag->addCssClass('your-custom-css-class');
  
  //Adds a text or a html to some tag
  $linkTag->setInnerHtml('Your link text');
  
  //Renders the tag...
  echo $linkTag->toString(\Umbrella\TagBuilder\TagRenderMode::NORMAL);
  
  
  // ... or render like this
  echo $linkTag;
  
  //Both will print <a href="#" class="your-custom-css-class">Your link text</a>

We have many render modes available like:

\Umbrella\TagBuilder\TagRenderMode::NORMAL

\Umbrella\TagBuilder\TagRenderMode::START_TAG

\Umbrella\TagBuilder\TagRenderMode::END_TAG

\Umbrella\TagBuilder\TagRenderMode::SELF_CLOSING

Testing

$ phpunit

Contributing

Please see CONTRIBUTING for details.

Credits

License

The MIT License (MIT). Please see License File for more information.

统计信息

  • 总下载量: 23.15k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 5
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2014-01-23

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固