Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

symfony2 twig render nesting sub directories

I seem to be having problems with twig render nesting

To explain further I have the following view layout structure

resources
  .. config
  .. public
  .. etc
  .. views
    .. WeekBreakDown
      ..  Export
          .. export.html.twig
          .. other.html.twig
      .. index.html.twig
      .. other.html.twig

Now I can render the following without error

$this->render('NameBundle:WeekBreakDown:index.html.twig');

or

$this->render('NameBundle:WeekBreakDown:other.html.twig');

What I am having trouble with is rendering the Export path.

I have tried

$this->render('NameBundle:WeekBreakDown:Export:index.html.twig');

and also..

$this->render('NameBundle:WeekBreakDown:Export\index.html.twig');

I get the InvalidArgumentException: Unable to find template

like image 322
Robbo_UK Avatar asked May 03 '13 10:05

Robbo_UK


1 Answers

This should work

$this->render('NameBundle:WeekBreakDown/Export:index.html.twig');
like image 180
Nisam Avatar answered Sep 19 '22 20:09

Nisam