Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce Twig function asset() #1175

Closed

Conversation

Quetzacoalt91
Copy link
Member

Questions Answers
Description? Align the project with a function asset() available on Twig when used in a Symfony environment. This replaces the current implementation where we always have to think about sending the base path from all controller.
Type? improvement
BC breaks? Nope
Deprecations? Nope
Fixed ticket? /
Sponsor company @PrestaShopCorp
How to test? Images are still displayed

@Quetzacoalt91 Quetzacoalt91 added the enhancement Type: Improvement label Feb 19, 2025
@Quetzacoalt91 Quetzacoalt91 self-assigned this Feb 19, 2025
@@ -664,13 +670,15 @@ public function getTwig()
$loader->addPath(realpath(__DIR__ . '/..') . '/views/templates', 'ModuleAutoUpgrade');
$twig = new Environment($loader);
$twig->addExtension(new TransFilterExtension3($this->getTranslator()));
$twig->addExtension(new AssetFunctionExtension3($this));
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Having the container as a parameter triggers the autowiring on the storybook side. Because of its string parameters, it cannot complete and makes the startup fail.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement Type: Improvement
Projects
Status: Closed
Development

Successfully merging this pull request may close these issues.

1 participant