Skip to main content
Home
Drupal life hacks

Main navigation

  • Drupal
  • React
  • WP
  • Contact
  • About
User account menu
  • Log in

Breadcrumb

  1. Home

TwigAllowed

By admin, 20 November, 2025
Drupal 11.3: Introducing the TwigAllowed Attribute for Safer Twig Templates

Drupal 11.3: Introducing the TwigAllowed Attribute for Safer Twig Templates

With Drupal 11.3, the way Twig templates access object methods has received a significant upgrade. The new TwigAllowed attribute provides developers and themers with a more secure and explicit method to control which object methods can be called from Twig.


The Problem with Legacy Method Access

Before Drupal 11.3, Twig templates could automatically access certain methods of objects based on magic prefixes like get, is, and has. For example:

Tags

  • Drupal
  • TwigAllowed
  • Twig
  • Drupal security
TwigAllowed
Powered by Drupal