Note that there are some explanatory texts on larger screens.

plurals
  1. POsymfony: routing goes always on the same route
    primarykey
    data
    text
    <p>I've got a big problem with routing: all pages matches with the same route!!</p> <p>routing.yml</p> <pre><code># default rules homepage: url: / param: { module: home, action: index } # generic rules # please, remove them by adding more specific rules localized_homepage: url: /:sf_culture/ param: { module: home, action: index } requirements: sf_culture: (?:it|en|es|fr) change_language: url: /change_language param: { module: language, action: changeLanguage } contatti: url: /:sf_culture/:contatti.html param: { module: contatti, action: index } requirements: sf_culture: (?:it|en|es|fr) about: url: /:sf_culture/:about.html param: { module: about, action: index } requirements: sf_culture: (?:it|en|es|fr) opera_slug: url: /:sf_culture/opere/:operaslug.html class: sfDoctrineRoute param: { module: opera, action: permalink } options: { model: Opera, type: object } requirements: sf_culture: (?:it|en|es|fr) opere: url: /:sf_culture/:opere.html param: { module: opera, action: index } requirements: sf_culture: (?:it|en|es|fr) default_index: url: /:module param: { action: index } default: url: /:module/:action/* </code></pre> <p>_header.php</p> <pre><code>&lt;ul&gt; &lt;li&gt;&lt;?php echo link_to(__('Home'), '@homepage') ?&gt;&lt;/li&gt; &lt;li&gt;&lt;?php echo link_to(__('About'), '@about?about='.strtolower(__('About'))) ?&gt;&lt;/li&gt; &lt;li&gt;&lt;?php echo link_to(__('Works'), '@opere?opere='.strtolower(__('Works'))) ?&gt;&lt;/li&gt; &lt;li&gt;&lt;?php echo link_to(__('Contacts'), '@contatti?contatti='.strtolower(__('Contacts'))) ?&gt;&lt;/li&gt; &lt;/ul&gt; </code></pre> <p>When I click on a button on my menu (_header), I'm always redirected to contacts page, and watching log, I can see</p> <pre><code>Match route "contatti" (/:sf_culture/:contatti.html) for /es/obras.html with parameters array ( 'module' =&gt; 'contatti', 'action' =&gt; 'index', 'sf_culture' =&gt; 'es', 'contatti' =&gt; 'obras',) </code></pre> <p>how is it possible? I've used @route sintax, so I tell symfony to use a particular route, but this is ignored.</p> <p>do you have any idea on how to solve it?</p> <p>Thanks a lot</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload