diff --git a/templating/twig_extension.rst b/templating/twig_extension.rst index 3a08ec059d7..bc84e6ae6e2 100644 --- a/templating/twig_extension.rst +++ b/templating/twig_extension.rst @@ -117,8 +117,10 @@ previous ``priceFilter()`` method:: // src/Twig/AppRuntime.php namespace App\Twig; + + use Twig\Extension\RuntimeExtensionInterface; - class AppRuntime + class AppRuntime implements RuntimeExtensionInterface { public function __construct() { @@ -135,6 +137,9 @@ previous ``priceFilter()`` method:: } } + .. versionadded:: 3.4 + The ``RuntimeExtensionInterface`` was introduced in Symfony 3.4. + If you're using the default ``services.yaml`` configuration, this will already work! Otherwise, :ref:`create a service ` for this class and :doc:`tag your service ` with ``twig.runtime``.