-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch '5.2' into compile-all-use-configured-locales
- Loading branch information
Showing
4 changed files
with
49 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<?php | ||
|
||
namespace Softspring\CmsBundle\Twig\Extension; | ||
|
||
use RuntimeException; | ||
use Symfony\WebpackEncoreBundle\Asset\EntrypointLookupCollectionInterface; | ||
use Twig\Extension\AbstractExtension; | ||
use Twig\TwigFunction; | ||
|
||
class WebpackExtension extends AbstractExtension | ||
{ | ||
public function __construct(protected ?EntrypointLookupCollectionInterface $entrypointLookupCollection = null) | ||
{ | ||
} | ||
|
||
public function getFunctions(): array | ||
{ | ||
return [ | ||
new TwigFunction('sfs_cms_encore_entry_reset', [$this, 'webpackResetEntrypoint']), | ||
]; | ||
} | ||
|
||
public function webpackResetEntrypoint(string $entrypointName = '_default'): void | ||
{ | ||
if (!$this->entrypointLookupCollection) { | ||
throw new RuntimeException('Webpack encore entrypoint lookup collection is not available'); | ||
} | ||
|
||
$this->entrypointLookupCollection->getEntrypointLookup($entrypointName)->reset(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,5 +68,7 @@ | |
</div> | ||
</main> | ||
</div> | ||
|
||
{% include '@SfsComponents/flash-messages/alerts.html.twig' %} | ||
{% endblock body %} | ||
|