From 5c32d4f0f8e15fb394f664691c23f737a6da6706 Mon Sep 17 00:00:00 2001 From: Chris Powell <22029493+ampedweb@users.noreply.github.com> Date: Fri, 2 Aug 2024 15:41:09 +0100 Subject: [PATCH] Update index.md You need to also add an additional RuntimeLoader for the TailwindRuntime class to get this to work standalone --- docs/index.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/index.md b/docs/index.md index ce2414b..1ee9eef 100644 --- a/docs/index.md +++ b/docs/index.md @@ -33,6 +33,11 @@ If you use Twig as standalone, then you need to add the extension manually $extension = new TalesFromADev\Twig\Extra\Tailwind\TailwindExtension(); $twig = new \Twig\Environment($loader); + +$twig->addRuntimeLoader(new FactoryRuntimeLoader([ + TailwindRuntime::class => function () { return new TailwindRuntime; }, +])); + $twig->addExtension($extension); ```