Could not find template in symfony 3

I know that there are a lot of such issues, but I did not find a solution

I have this problem

Cannot find template "CoreBundle: index.html.twig" (viewed: / var / www / html / MyProject / vendor / symfony / symfony / src / Symfony / Bridge / Twig / Resources / views / Form).

This is architecture enter image description here This is my controller

<?php namespace CoreBundle\Controller; use Symfony\Bundle\FrameworkBundle\Controller\Controller; use Symfony\Component\HttpFoundation\Request; use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route; class DefaultController extends Controller { /** * @Route("/", name="index") */ public function indexAction(Request $request) { return $this->render('CoreBundle:index.html.twig'); } /** * @Route("/ma-personnalite", name="ma-personnalite") */ public function mapersonnaliteAction(Request $request) { return $this->render('CoreBundle:ma_personnalite.html.twig'); } /** * @Route("/cv", name="cv") */ public function cvAction(Request $request) { return $this->render('CoreBundle:cv.html.twig'); } /** * @Route("/scolaires", name="scolaires") */ public function scolairesAction(Request $request) { return $this->render('CoreBundle:scolaires.html.twig'); } /** * @Route("/extra-scolaires", name="extra-scolaires") */ public function extrascolairesAction(Request $request) { return $this->render('CoreBundle:extra_scolaires.html.twig'); } /** * @Route("/contact", name="contact") */ public function contactAction(Request $request) { return $this->render('CoreBundle:contact.html.twig'); } } 

This is config.yml

 #app/config/routing.yml core: resource: "@CoreBundle/Controller/" type: annotation prefix: / 

thank you for your time

+5
source share
2 answers

try changing this:

 return $this->render('CoreBundle:index.html.twig'); 

:

 return $this->render('CoreBundle::index.html.twig'); 

The difference is to use :: instead of :

+1
source

According to the Symfony 3 Docs, it is better to use slashes and not use the word "Bundle".

So we have an example:

 return $this->render('@BloggerBlog/Default/index.html.twig'); 
+7
source

Source: https://habr.com/ru/post/1268733/


All Articles