You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In app/config/twigbridge.php I added in extensions->enabled section an entry:
TwigExtraCacheExtension::class,
When I try to use the cache block, I get an error:
ErrorException (E_ERROR)
Unable to load the "Twig\Extra\Cache\CacheRuntime" runtime.
The twig documentation says:
If you are not using Symfony, you must also register the extension runtime:
useSymfony\Component\Cache\Adapter\FilesystemAdapter;
useSymfony\Component\Cache\Adapter\TagAwareAdapter;
useTwig\Extra\Cache\CacheRuntime;
useTwig\RuntimeLoader\RuntimeLoaderInterface;
$twig->addRuntimeLoader(newclassimplements RuntimeLoaderInterface {
publicfunctionload($class) {
if (CacheRuntime::class === $class) {
returnnewCacheRuntime(newTagAwareAdapter(newFilesystemAdapter()));
}
}
});
However, I have no idea where in the application to add such a loader. From what I see, extensions are added in this file: vendor/barryvdh/laravel-form-bridge/src/ServiceProvider.php
Does this mean I should overwrite this service provider and use a custom one?
The text was updated successfully, but these errors were encountered:
Hey,
I am trying to use the twigphp/cache-extra (https://twig.symfony.com/doc/3.x/tags/cache.html) extension in TwigBridge.
In
app/config/twigbridge.php
I added in extensions->enabled section an entry:When I try to use the cache block, I get an error:
The twig documentation says:
However, I have no idea where in the application to add such a loader. From what I see, extensions are added in this file:
vendor/barryvdh/laravel-form-bridge/src/ServiceProvider.php
Does this mean I should overwrite this service provider and use a custom one?
The text was updated successfully, but these errors were encountered: