gpt4 book ai didi

php - Symfony3 404 NotFoundHttpException

转载 作者:搜寻专家 更新时间:2023-10-31 21:25:41 27 4
gpt4 key购买 nike

我正在使用 Symfony3 进行开发,现在我的问题是在尝试访问“http://localhost:8000/auth 页面”时出现“404 错误”

开发日志

[2016-04-18 18:30:14] request.ERROR: Uncaught PHP Exception Symfony\Component\HttpKernel\Exception\NotFoundHttpException: "GuideBundle\Entity\MedicalStaff object not found." at D:\Elya\КПИ\6 семестр\TSPP\mg\vendor\sensio\framework-extra-bundle\Request\ParamConverter\DoctrineParamConverter.php line 66  []

它以前有效(我不记得我做了什么让它失败)。我的routing.yml

auth:
path: /auth
defaults: {_controller: GuideBundle:Security:login}

SecurityController.php

 class SecurityController extends Controller
{
/**
* @Route("/auth", name="auth")
*/
public function loginAction(Request $request)
{
//Here is the code, If I comment It nothing changes and I don't use here any MedicalStaff object
}

}

MedicalStaff.php 位于 GuideBundle\Entity 文件夹中

namespace GuideBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
* MedicalStaff
*
* @ORM\Table(name="medical_staff")
* @ORM\Entity(repositoryClass="GuideBundle\Repository\MedicalStaffRepository")
*/
class MedicalStaff
{
//here are methods and properties
}

谁能说说是什么导致了这种类型的问题?

最佳答案

这个YML

auth:
path: /auth
defaults: {_controller: GuideBundle:Security:login}

会和你的注解冲突

class SecurityController extends Controller
{
/**
* @Route("/auth", name="auth")
*/
public function loginAction(Request $request)
{
//Here is the code, If I comment It nothing changes and I don't use here any MedicalStaff object
}

}

使用一个而不是两个,检查您的配置以查看您应该使用哪个。

关于php - Symfony3 404 NotFoundHttpException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36699894/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com