This project is not covered by Drupal’s security advisory policy.

Note: The feature is merged to at_base

Provide some helper method for theming.

Check the tests for more details.

Install

Download Twig library to /sites/all/libraries/twig — where we can find /sites/all/libraries/twig/lib/Twig/Autoloader.php

at_require.module can help download libraries automatilcally.

Twig template is supported

$template_file = drupal_get_path('module', 'atest_theming') . '/templates/hello.twig';
echo at_theming_render_template($template_file, array('name' => 'Andy Truong'));

Filters for Drupal:

- {{ 'view_name' | drupalView }} — if views.module is enabled
- %theme/templates/views/%view_name[.%display_id].html.twig will be used if it's available
- {{ node | kpr }} — if devel.module is enabled
- {{ 'system:powered-by' | drupalBlock }}
- {{ 'boxes:box-delta' | drupalBlock }}
- {{ render_array | render }}
- {{ 'node/1' | url }}
- {{ string | filterautop}}
- {{ translate_me | t }}

Functions

- {% for i in element_children(render_array) %} {{ render_array[i] | render }} {% endfor %}

Depends on

- https://drupal.org/project/at_base
- https://drupal.org/project/at_autoload
- https://drupal.org/project/at_require (good to have)

Project information

Downloads