jacerider/neo_twig 问题修复 & 功能扩展

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

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

jacerider/neo_twig

最新稳定版本:1.0.20

Composer 安装命令:

composer require jacerider/neo_twig

包简介

Provides twig helpers.

README 文档

README

  • Introduction
  • Requirements
  • Installation
  • Tools

INTRODUCTION

Provides twig helpers for Drupal.

REQUIREMENTS

This module requires no modules outside of Drupal core.

INSTALLATION

Install as you would normally install a contributed Drupal module. Visit https://www.drupal.org/node/1897420 for further information.

TOOLS

Class

Add a class to an element.

{{ field_image|neo_class('bg-base-500') }}

Class to Children

Add a class to an children of a renderable.

{{ field_images|neo_child_class('bg-base-500') }}

You can also target nested elements within a child by defining the path to the nested element.

{{ field_images|neo_child_class('bg-base-500', ['images', 'image', '#attributes']) }}

Children

Get children of a content field.

<ul>
  {% for tag in content.field_tags|neo_children %}
    <li>{{ tag }}</li>
  {% endfor %}
</ul>

Field

Render a field from a nested entity reference field.

{% for key, item in content.field_reference|neo_children %}
  {{ item|neo_field('field_image') }}
{% endfor %}

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: proprietary
  • 更新时间: 2024-08-26