Php Symfony3 404 NotFoundHttpException
我正在使用Symfony3进行开发,现在我的问题是在尝试访问“页面”时出现“404错误” 开发日志Php Symfony3 404 NotFoundHttpException,php,http-status-code-404,symfony,Php,Http Status Code 404,Symfony,我正在使用Symfony3进行开发,现在我的问题是在尝试访问“页面”时出现“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 семестр\T
[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 []
它以前成功过(我不记得我做了什么使它失败)。
Myrouting.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
}
}
使用一个而不是两个,检查您的配置以查看您应该使用哪一个。您确定这是Symfony尝试访问的控制器吗?错误消息表示它正试图为使用参数转换器(失败)的路由提供服务。您可以使用
debug:router
和router:match
命令检查请求实际访问的路由,或查看应用程序的日志。而不是404:“未找到GuideBundle\Entity\MedicalStaff对象。”@ManoDestra我收到404错误browser@xabbuh试图php-bin/console-router:match/auth
我得到了“var\cache\dev/assetic/routing.yml”不包含valide UTF-8 YML。请检查此文件/行中是否有违规项:D:\Elya\kgППППП\6С挈挈挈挈挈挈С挈挈挈挈挈挈挈挈2535。