定制 piedweb/render-html-attributes 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

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

piedweb/render-html-attributes

最新稳定版本:v0.1.901

Composer 安装命令:

composer require piedweb/render-html-attributes

包简介

[Twig Extension] Transform an array in html tag attributes.

README 文档

README

Latest Version Software License Code Coverage Type Coverage Total Downloads

This package is an extension for both Twig and Plate engine Plates.

Plates is not anymore supported since v1.0.3.

Two features for the same goal Manipulate html tag attributes via object/PHP array :

  • attr({class: "col", id: "piedweb", data-content:"Hello :)', ...}) transform an array in html tag attributes
  • mergeAttr($attributes1, $attributes2, [$attributes3, ...]) merge multiple array without loosing values (Eg. : ['class' => 'main'] + ['class' => 'content'] = ['class' => 'main content'])

Table of contents

Usage

Load the extension in twig (eg for symfony) :

        piedweb.twig.extension.render_attributes:
        class: PiedWeb\RenderAttributes\TwigExtension
        public: false
        tags:
            - { name: twig.extension }

Then use it :

{{ attr({class:"main content"})|raw }}
{{ mergeAttr({class:"main"}, {class:"content"})|raw }}

Installation

composer require piedweb/render-html-attributes

Requirements

Stand alone extension.

See composer.json file.

Contributors

License

MIT (see the LICENSE file for details)

Open Source Package

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2018-11-12

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固