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
其他信息
- 授权协议: MIT
- 更新时间: 2017-08-17