简体   繁体   English

FileLoaderLoadException-无法使LexikJWTAuthenticationBundle工作-Symfony

[英]FileLoaderLoadException - can not get LexikJWTAuthenticationBundle to work - Symfony

I am trying to build my rest api with symfony and https://github.com/FriendsOfSymfony/FOSRestBundle I did everything as described in examples but everytime i set the type of my api to "rest" in my routing.yml i get the following error: 我正在尝试使用symfony和https://github.com/FriendsOfSymfony/FOSRestBundle构建我的rest api,按照示例中的描述进行所有操作,但是每次我在route.yml中将我的api类型设置为“ rest”时,我都会得到以下错误:

[Symfony\Component\Config\Exception\FileLoaderLoadException]                                                                      
Class could not be determined for Controller identified by 
"InveusUserBundle/Controller/UsersController" in 
InveusUserBundle/Controller/UsersController
(which is being imported from "/vagrant/app/config/routing.yml").
Make sure there is a loader supporting the "rest" type.                                                                    

Add route to your controller in: YourBundle/Resources/config/routing.yml 在以下位置添加到控制器的路由:YourBundle / Resources / config / routing.yml

myconfig:
    type: rest
    prefix: /api
    resource: YourBundle\Controller\Api\YourController
    name_prefix:  api_ # naming collision

Imoprt your bundle routing.yml file into app/config/routing.yml 将您的bundle routing.yml文件输入到app / config / routing.yml中

appRoute:
    resource: "@YourBundle/Resources/config/routing.yml"
    type: rest
    prefix:   /api

This config should fix the error. 此配置应修复该错误。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM