定制 drupal-pattern-lab/add-attributes-twig-extension 二次开发

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

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

drupal-pattern-lab/add-attributes-twig-extension

最新稳定版本:v1.0.1

Composer 安装命令:

composer require drupal-pattern-lab/add-attributes-twig-extension

包简介

Twig function that allows addition of attributes that can be rendered in both Drupal and Pattern Lab

README 文档

README

Twig function that allows addition of attributes that can be rendered in both Drupal and Pattern Lab. Merges with template level attributes in Drupal and prevents them from trickling down into includes.

Usage

{% set additional_attributes = {
  "class": ["foo", "bar"],
  "baz": ["foobar", "goobar"],
  "foobaz": "goobaz",
} %}

<div {{ add_attributes(additional_attributes) }}></div>

Can also be used with the bem function:

{% set additional_attributes = {
  "class": bem("foo", ["bar", "baz"], "foobar"),
} %}

<div {{ add_attributes(additional_attributes) }}></div>

统计信息

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

GitHub 信息

  • Stars: 8
  • Watchers: 0
  • Forks: 4
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-08-17