Jump to content

Is it possible to use twig in a front hook?


Recommended Posts

Hi,

I tried using twig in the front office but got this error

You have requested a non-existent service "twig".

My code sample

$summary = $this->get('twig')->render(
    '@Modules/mymodule/views/templates/hook/summary.twig',
    [
        // ...
    ]
);

Is it possible to replace smarty with twig in front-office hooks?

Thank you

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...