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

[TwigHooks] Template configuration provider with context #208

Merged

Conversation

loic425
Copy link
Member

@loic425 loic425 commented Jan 7, 2025

Fixes #11

sylius_twig_hooks:
    hooks:
        'sylius_admin.book.show.content.header.title_block':
            title:
                template: '@SyliusBootstrapAdminUi/shared/crud/common/content/header/title_block/title.html.twig'
                configuration:
                    title: '@=_context.book.getTitle()'

@loic425 loic425 force-pushed the feature/template-configuration-with-context branch 3 times, most recently from 7490388 to 4a6589e Compare January 8, 2025 07:31
@loic425 loic425 added the feature label Jan 8, 2025
@loic425 loic425 force-pushed the feature/template-configuration-with-context branch 2 times, most recently from 9dc9cae to a7d1680 Compare January 8, 2025 07:43
@loic425 loic425 force-pushed the feature/template-configuration-with-context branch from a7d1680 to 2cd4ed9 Compare January 8, 2025 08:33
@loic425 loic425 merged commit d34a35b into Sylius:main Jan 8, 2025
6 checks passed
@loic425 loic425 deleted the feature/template-configuration-with-context branch January 8, 2025 14:26
use Sylius\TwigHooks\Twig\Runtime\HooksRuntime;
use Twig\Environment as Twig;

final class HookableTemplateRenderer implements SupportableHookableRendererInterface
{
public function __construct(
private readonly Twig $twig,
private readonly TemplateConfigurationProviderInterface $configurationProvider,
Copy link
Member Author

Choose a reason for hiding this comment

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

we are in 0.x, I don't think we need a bc layer for that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Twig Hooks] No @= support in the configuration
4 participants