【发布时间】:2014-02-21 03:58:15
【问题描述】:
尝试访问//localhost/dga/web/app_dev.php/gerer/sami 时出现以下异常。
找不到“GET /gerer/sami”的路线 404 Not Found - NotFoundHttpException 1 链接异常:
ResourceNotFoundException »
src/app/config/routing.yml
gestion_utilisateur:
resource: "@GestionUtilisateurBundle/Controller"
type: annotation
prefix: /
src/Application/EncaissementBundle/Controller/GererController.php
namespace Application\EncaissementBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Template;
class DefaultController extends Controller
{
/**
* @Route("/gerer/{name}", name="application_encaissement_gere")
* @Template()
*/
public function indexAction($name)
{
return $this->render(
'ApplicationEncaissementBundle:Gerer:index.html.twig',
array('name' => $name)
);
}
【问题讨论】:
-
GererController.php 中的默认控制器?
-
文件名和类名不匹配应该是导致此问题的原因@AhmedSiouani 正确指出:)