I am learning symfony 3.4 and I am trying to link a route with a view. When I run the program using the route:
http://127.0.0.1:8000/home
It generates the following: Unable to find template "BlogBundle :: home.html.twig"
My routing.yml file is as follows:
blog:
resource: "@BlogBundle/Controller/"
type: annotation
prefix: /
app:
resource: "@AppBundle/Controller/"
type: annotation
My driver is as follows:
<?php
namespace BlogBundle\Controller;
use Symfony\Component\HttpFoundation\Response;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
class DefaultController extends Controller
{
/**
* @Route("/home",name="home_route")
* @Method({"GET"})
*/
public function indexAction()
{
//esta sentencia funciona
//return new Response('<html><body>hola mundo</body></html>' );
//
return $this->render('BlogBundle::inicio.html.twig');
}
}
My file inicio.html.twig
is as follows:
Hello World!
If someone can guide me on how to solve this problem or any suggestion will be well received, I am a bit complicated and just beginning.