0
我有問題,當我嘗試使用路線。它不能被生成,我通過/app/config/routes.xml嘗試,但是當我修改我得到錯誤,該文件不是YAML格式。Symfony 3.3.10路線
控制器看起來:
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Symfony\Component\HttpFoundation\Request;
class MainController extends Controller
{
public function indexAction(Request $request)
{
return $this->render('main/index.html.twig', [
'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR,
]);
}
}
當我試圖訪問/索引或主/索引它給我的路線不存在! :@
當我放置使用Sensio \ Bundle \ FrameworkExtraBundle \ Configuration \ Route;首先在Controller之前。