php - Extending twig template when both are within /app directory -


I am trying to create custom error pages in symfony2, but my site theme inside error.html.twig / There is a problem using the layout

As I mentioned here:

I overridden the error file and received my app / resource / twig bundle / view / Exception / error is put in html.twig . If I use static content it all works fine, but I would like to use the {% extends ':: base.html.twig'%} as I would with all other pages Yes, so I can copy my current layouts and styles.

base.html.twig is located on app / resource / visual / base.html.twig . How do I go about expanding this template?

Besides, just out of curiosity, is there any way to override the 'Twelve Bundle' bundle, especially without any error pages within one of my ponds?

UPDATE

OK, it was resolved with the help of 'Wow J'. It has been found that the file was being found, but the file which was extended It is using is_granted if it is called in the docs then by adding the app.user and if written in the statement.

:: base.html.twig syntax is not relative. This means that it will work everywhere.

The complete syntax for the template path is BundleName: DirName: FileName . Then the AcmeDemoBundle: page: home.html.twig refers to @ AcmeDemoBundle / resource / view / page / home.html.twig .

If DirName is not used, eg AcmeDemoBundle :: layout.html.twig, call it @ AcmeDemoBundle / Resource / View / Will be resolved for layout.html.twig .

If BundleName is not used, it is assumed that the app / resource / view in the template.

then : base.html. Twenty refers to the full path app / resource / view / base.html.twig (this is not complete, because I do not know the full path for the app < / Code> Deer in your case, but when symphony does it will be complete).

Less : You can only use :: base.html .twig

Comments

Popular posts from this blog

c - Mpirun hangs when mpi send and recieve is put in a loop -

python - Apply coupon to a customer's subscription based on non-stripe related actions on the site -

java - Unable to get JDBC connection in Spring application to MySQL -