2016-08-01 87 views
0

我在做一個資源的contentType和使用它的404頁其次the guide in the documentation,但不是我看到下面的致命錯誤的頁面:致命錯誤,而不是404頁

Class: Symfony\Component\HttpKernel\Exception\HttpException 
Message: The page could not be found, and there is no 'notfound' set in 'config.yml'. Sorry about that. 
Code: 0 

這很奇怪,因爲not found in config.yml設置爲:

notfound: resources/not-found 

任何想法它可能是什麼?這裏是的contentType:

resources: 
name: Resources 
singular_name: Resource 
fields: 
    title: 
     type: text 
     class: large 
     required: true 
    slug: 
     type: slug 
     uses: title 
    html: 
     type: textarea 
     height: 150px 
default_status: published 
record_template: resource.twig 
searchable: false 
viewless: true 

而且resource.twig:

{{ record.title }} 

我創建的/資源/不被發現

回答

0

確保資源記錄是404資源的唯一的別名「發表」。

......如果每次我親自打過這一個,結果都是1美元,那應該是假期。

+0

它已出版。 – Pharetra

0

資源內容類型不是正確的工具。使用slug not-found更好地發佈站點並將其設置在配置中。

您的代碼無法運行的原因: 您對資源contenttype設置了viewless: true,這意味着在前端沒有它的路由。