Skip to content

Commit

Permalink
Merge pull request #830 from bolt/Use-FilesystemLoader-so-widgets-can…
Browse files Browse the repository at this point in the history
…-set-the-loader-in-`APP_DEBUG=0`-env-settings

Use "FilesystemLoader" so widgets can set the loader in `APP_DEBUG=0` env settings
  • Loading branch information
bobdenotter authored Jan 5, 2020
2 parents 2dacd5f + 503a062 commit 403db08
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/Widget/BaseWidget.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
use Bolt\Extension\ExtensionInterface;
use Bolt\Widget\Exception\WidgetException;
use Cocur\Slugify\Slugify;
use Symfony\Bundle\TwigBundle\Loader\NativeFilesystemLoader;
use Twig\Error\LoaderError;
use Twig\Loader\FilesystemLoader;

/**
* BaseWidget can be used as easy starter pack or as a base for your own widgets.
Expand Down Expand Up @@ -183,10 +183,10 @@ public function getTemplateFolder(): ?string

private function addTwigLoader(): void
{
/** @var NativeFilesystemLoader $twigLoaders */
/** @var FilesystemLoader $twigLoaders */
$twigLoaders = $this->getTwig()->getLoader();

if ($twigLoaders instanceof NativeFilesystemLoader) {
if ($twigLoaders instanceof FilesystemLoader) {
$twigLoaders->addPath($this->getTemplateFolder(), $this->getSlug());
}
}
Expand Down

0 comments on commit 403db08

Please sign in to comment.