Symfony2 cannot find branch template

I am 2 hours new in Symfony2, so sorry my noob question. I get an error message:

Unable to find template "Akademiah:MemberBundle:Default:index.html.twig".
500 Internal Server Error - InvalidArgumentException
3 linked Exceptions: Twig_Error_Loader Β» InvalidArgumentException Β» InvalidArgumentException Β»

Not sure why this shows up when I follow the tutorial, and is it expected that everything will work at this stage?

My controller has the following:

<?php

namespace Akademiah\MemberBundle\Controller;

use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;

class DefaultController extends Controller
{
    /**
     * @Route("/hello/{name}")
     * @Template()
     */
    public function indexAction($name)
    {
            return $this->render('MemberBundle:Default:index.html.twig',array('name'=>$name));    
    }
}

and I created the package using the php app / console command. Help is appreciated.

+4
source share
1 answer

You should check if the file with the name index.html.twigin your folder exists resources/twig/default/. If it is not, create it.

0
source

All Articles