rcrowe / TwigBridge

Give the power of Twig to Laravel
MIT License
894 stars 168 forks source link

Template inheritance problem. #63

Closed mcheptea closed 10 years ago

mcheptea commented 10 years ago

Hello,

This is more a usage bug than a structural one. However I could not find a solution anywhere else.

Problem:

When attempting to extend a template with:

{% extends "base.twig" %} {%block title%}My Title{%endblock%}

I get the following error:

Twig_Error_Loader Unable to find template "base.twig" (looked into: C:\wamp\www\devaidv4\app\config/../views, C:\wamp\www\devaidv4\app\config/../views).

The 'base.twig' file is located in '../app/views/base.twig' The child template in '../app/views/home/child.twig'

Note: the same example works fine in codeigniter. I sure there's a configuration problem, I use the default configuration which comes with the composer package.

Please let me know if you see something wrong.

Anahkiasen commented 10 years ago

Try without the .twig extension ?

mcheptea commented 10 years ago

Same problem:

Child template contents: {% extends "base" %} {%block title%}Test{%endblock%}

Parent: {%block title%}default{%endblock%}

Result: Twig_Error_Loader Unable to find template "base.twig" (looked into: C:\wamp\www\devaidv4\app\config/../views, C:\wamp\www\devaidv4\app\config/../views).

mcheptea commented 10 years ago

Solved. It was an IDE problem encoding problem (I'm using netbeans 7.4beta), the saved file had a problem. Restarting the IDE and recreating the files solved the issue. Sorry for taking the time.