2

A Twig template in one bundle calls another Twig template in another bundle, but I can't reference it.

The file is in this folder:

src/Company/Bundle/ActivityBundle/Resources/views/Default/index.html.twig

And I am trying to reference it from a Twig file in another bundle like this:

{% extends "Company/Bundle/ActivityBundle/index.html.twig" %}

I've tried every possible combination, but it just doesn't pick it up and I get a "Twig_Error_Loader: Unable to find template" error

4

1 に答える 1

2

Defaultテンプレートパスの一部を見逃していると思います:

{% extends "Company/Bundle/ActivityBundle/Default/index.html.twig" %}

または私がもっと好むように:

{% extends "CompanyBundleActivityBundle:Default:index.html.twig" %}

お役に立てれば ;)

于 2013-03-20T15:55:10.740 に答える