Jump to content

Extending a template from module .. what's the difference between these two methods?


mzfp

Recommended Posts

Hi

I'm experimenting with overriding and extending twig templates from a custom Prestashop module.  

Custom file:
modules/my_module/views/PrestaShop/Admin/Sell/Customer/view.html.twig

In the file above if I place:

{% extends '@PrestaShop/Admin/Sell/Customer/view.html.twig' %}

It crashes the back office - no error - simply runs out of memory.

However, if use the following approach it works:

{% extends '@!PrestaShop/Admin/Sell/Customer/view.html.twig' %}

note that I added the ! operator just before Prestashop.

What is the difference and why does one work and not the other?

Link to comment
Share on other sites

Thanks.  Am I correct in my understanding that the not operator (!) ensures that the template is extended from the base template (and another version extended from another module) ?  I read through both links but could not really find a clear explanation of why the ! operator needs to be used.  I'm curious about this

 

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...