2012-04-19 42 views
0

更新包括一些新航線的申請後,symfony中無法匹配任何路線:Symfony的不匹配/找到任何路線

symfony [err] {sfConfigurationException} Unable to find a matching route to generate url for params "array ( 'action' => 'changeLanguage', 'module' => 'language', 'culture' => 'en_US',)" 

什麼我需要做的,使symfony的查找/匹配再次路線?

因此,這裏是我的路由 的routing.yml

<?php $cultures = implode(I18NUtils::availableCultures(), '|') ?> 

locality_list: 
    url: /:sf_culture/orte/:slug.:season.:id.:sf_format 
    class: sfPropelRoute 
    options: { model: Locality, type: object } 
    param: { module: locality, action: list, sf_format: html } 
    requirements: 
    id: \d+ 
    sf_method: [get] 

locality_info: 
    url: /:sf_culture/orte/:slug.:season.:id.details.:sf_format 
    class: sfPropelRoute 
    options: { model: Locality, type: object } 
    param: { module: locality, action: show, sf_format: html } 
    requirements: 
    id: \d+ 
    sf_method: [get] 

housings_by_category: 
    url: /:sf_culture/category/:slugs 
    param: { module: housing, action: listByCategory, sf_format: html } 
    requirements: 
    sf_culture: (?:<?php echo $cultures ?>) 

housings_by_tag_locality: 
    url: /:sf_culture/tag/:tags/:locality_id 
    param: { module: housing, action: listByTag, sf_format: html } 
    requirements: 
    sf_culture: (?:<?php echo $cultures ?>) 

housings_by_tag: 
    url: /:sf_culture/tag/:tags 
    param: { module: housing, action: listByTag, sf_format: html } 
    requirements: 
    sf_culture: (?:<?php echo $cultures ?>) 

housings_by_locality: 
    url: /:sf_culture/:slug.:season.:id.list.:sf_format 
    class: sfPropelRoute 
    options: { model: Locality, type: object } 
    param: { module: housing, action: list, sf_format: html } 
    requirements: 
    id: \d+ 
    sf_method: [get] 

housing_info: 
    url: /:sf_culture/:slug.:season.:id.:sf_format 
    class: sfPropelRoute 
    options: { model: Housing, type: object } 
    param: { module: housing, action: show, sf_format: html } 
    requirements: 
    id: \d+ 
    sf_method: [get] 

housings: 
    url: /:sf_culture/ 
    param: { module: housing, action: index } 
    requirements: 
    sf_culture: (?:<?php echo $cultures ?>) 

hut_details: 
    url: /:sf_culture/huetten/:slug.:season.:id.:sf_format 
    class: sfPropelRoute 
    options: { model: Housing, type: object } 
    param: { module: housing, action: show, sf_format: html } 
    requirements: 
    id: \d+ 
    sf_method: [get] 

huts: 
    url: /:sf_culture/huetten 
    param: { module: hut, action: index } 
    requirements: 
    sf_culture: (?:<?php echo $cultures ?>) 

legacy_redirect: 
    url: /incoming/:action/* 
    param: { module: legacysite, sf_format: html } 

home: 
    url:/
    param: { module: home, action: index } 

localized_home: 
    url: /:sf_culture/ 
    param: { module: home, action: index } 
    requirements: 
     sf_culture: (?:<?php echo $cultures ?>) 

change_language: 
    url: /language 
    param: { module: language, action: changeLanguage } 

# default rules 
default_index: 
    url: /:sf_culture/:module 
    param: { action: index } 
    requirements: 
    sf_culture: (?:<?php echo $cultures ?>) 

default: 
    url: /:sf_culture/:module/:action/* 
    param: { sf_format: html } 
    requirements: 
    sf_culture: (?:<?php echo $cultures ?>) 
+0

你可以在問題中添加你的'routing.yml'嗎? – j0k 2012-04-19 14:39:59

+0

好吧,我添加了該文件。 – 2012-04-19 14:47:11

+0

這是什麼版本的symfony? – halfer 2012-04-19 14:53:02

回答

0

您需要culture參數去你change_language路線:

change_language: 
    url: /language/:culture 
    param: { module: language, action: changeLanguage } 
符合你的要求太

可能。