我生成一個包,但我收到錯誤試圖訪問網址http://localhost/app_dev.php/event:Symfony的航線,但現有的調試器路徑結果
No route found for "GET /event"
然後我調試與調試路由器:路由器和路由器似乎是精細:
event_homepage ANY ANY ANY
/hello/{firstName}/{count}
event_index GET ANY ANY /event/
event_show GET ANY ANY /event/{id}/show
event_new GET|POST ANY ANY /event/new
event_edit GET|POST ANY ANY /event/{id}/edit
event_delete DELETE ANY ANY /event/{id}/delete
我已經自動創建包後,我有這個錯誤:
[ERROR] The bundle's "Resources/config/routing.yml" file cannot be imp
orted
from "app/config/routing.yml" because the "EventBundle" bundle is
already imported. Make sure you are not using two different
configuration/routing formats in the same bundle because it won't work
下面是所有的路由結構文件:
/home/stefano/starwarsevents/app/config/routing.yml
event:
resource: "@EventBundle/Resources/config/routing.yml"
prefix: /
/家庭/斯特凡諾/ starwarsevents/src目錄/ EventBundle /資源/配置/路由.yml
event_homepage:
path: /hello/{firstName}/{count}
defaults: { _controller: EventBundle:Default:index }
event_event:
resource: "@EventBundle/Resources/config/routing/event.yml"
prefix: /event
/home/stefano/starwarsevents/src/EventBundle/Resources/config/routing/event.yml
event_index:
path: /
defaults: { _controller: "EventBundle:Event:index" }
methods: GET
event_show:
path: /{id}/show
defaults: { _controller: "EventBundle:Event:show" }
methods: GET
event_new:
path: /new
defaults: { _controller: "EventBundle:Event:new" }
methods: [GET, POST]
event_edit:
path: /{id}/edit
defaults: { _controller: "EventBundle:Event:edit" }
methods: [GET, POST]
event_delete:
path: /{id}/delete
defaults: { _controller: "EventBundle:Event:delete" }
methods: DELETE
有可能是'/事件/'和'/事件/ {ID}/show'之間的衝突。嘗試禁用第二個(甚至所有的人),看看你得到任何積極的結果(第一次)。 – Confidence
我試過但沒有。 。 。我編輯了這個帖子並添加了所有的路由結構,我真的不知道這裏有什麼問題 –