我是Symfony的新手。我有个问题。我创建了一个新的包。我做了必要的设置。但是我收到以下错误。
我想在BlogBundle / Defaults下打开index.html.twig。
Unable to find template "BlogBundle:Default:index.html.twig" (looked into: C:\xampp\htdocs\deneme\app/Resources/views, C:\xampp\htdocs\deneme\vendor\symfony\symfony\src\Symfony\Bridge\Twig/Resources/views/Form).
DefaultController:
<?php
namespace BlogBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
class DefaultController extends Controller
{
/**
* @Route("/")
*/
public function indexAction()
{
return $this->render('BlogBundle:Default:index.html.twig');
}
}
routing:
blog:
resource: "@BlogBundle/Controller/"
type: annotation
prefix: /
app:
resource: '@AppBundle/Controller/'
type: annotation
作曲家:
"name": "user/my_project",
"license": "proprietary",
"type": "project",
"autoload": {
"psr-4": {
"AppBundle\\": "src/AppBundle",
"BlogBundle\\": "src/BlogBundle"
},
"classmap": [
"app/AppKernel.php",
"app/AppCache.php"
]
},
请帮帮我。 感谢。
答案 0 :(得分:0)
你需要在以下树之一下有一个index.html.twig文件: