Skip to content

Commit 0e8d863

Browse files
tjampsjaviereguiluz
authored andcommitted
Add missing RuntimeExtensionInterface
If the Twig runtime class does not implement RuntimeExtensionInterface, the autoconfigure feature of the container will not tag it with `twig.runtime`, and an exception will be thrown ("Unable to load the "App\Twig\AppRuntime" runtime.")
1 parent a455e7a commit 0e8d863

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

templating/twig_extension.rst

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,9 @@ previous ``priceFilter()`` method::
115115
// src/AppBundle/Twig/AppRuntime.php
116116
namespace AppBundle\Twig;
117117

118-
class AppRuntime
118+
use use Twig\Extension\RuntimeExtensionInterface;
119+
120+
class AppRuntime implements RuntimeExtensionInterface
119121
{
120122
public function __construct()
121123
{

0 commit comments

Comments
 (0)