2016-07-26 86 views
0

我現有的應用程序需要額外的RESTful端點。Symfony結合了基本路由和REST

我已經用以下配置添加了FOSRestBundle。

fos_rest: 
    param_fetcher_listener: true 
    view: 
    mime_types: 
     json: ['application/json', 'application/json;version=1.0', 'application/json;version=1.1', 'application/json;version=1.2'] 
    view_response_listener: 'force' 
    formats: 
     xml: false 
     json: true 
    templating_formats: 
     html: false 
    format_listener: 
     rules: 
     - priorities: [json, xml] 
     - fallback_format: json 
    exception: 
     codes: 
     'Symfony\Component\Routing\Exception\ResourceNotFoundException': 404 
     'Doctrine\ORM\OptimisticLockException': HTTP_CONFLICT 
     messages: 
     'Symfony\Component\Routing\Exception\ResourceNotFoundException': true 
    allowed_methods_listener: true 
    access_denied_listener: 
     json: true 
    body_listener: true 
    routing_loader: 
     default_format: json 
     include_format: false 

其餘請求是罰款,但基本的路由現在不工作

,出現以下錯誤

This page contains the following errors: 

error on line 11 at column 92: EntityRef: expecting ';' 
Below is a rendering of the page up to the first error. 

基本上我只是想基本的路由休息

回答