嘗試訪問//localhost/dga/web/app_dev.php/gerer/sami
時出現以下異常。Symfony2路由註釋導致NotFoundHttpException 1鏈接異常:ResourceNotFoundException
未發現 「GET/gerer /薩米」 路線404未找到 - NotFoundHttpException 1種連接異常:
ResourceNotFoundException »
SRC /應用/配置/ 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)
);
}
DefaultController in GererController.php? –
文件名和類名稱不匹配應該是這個問題的原因,因爲@AhmedSiouani指出正確:) – nifr