Question

I need to convert my existing routes.ini file to an XML file (my host disabled parse_ini of PHP). Anyway, I couldn't find proper examples so I tried my luck using the conventional Zend_Config_XML structure. See below:

<?xml version="1.0"?>
<configdata>
 <routes>
  <Home route=":locale/">
   <defaults controller="index" action="index" locale="tr_TR"/>
  </Home>
 </routes>
 <routes>
  <NewsList route=":locale/news-list/:pageID">
   <defaults controller="index" action="newsList" locale="tr_TR"/>
  </NewsList>
 </routes>
<configdata>

However it didn't work; above example says "NewsList" route is not there. I found some examples in offical documentation but they also didn't help.

Can someone assist on correct XML structure?

Thanks, Gokcen

Was it helpful?

Solution

<?xml version="1.0"?>
<configdata>
  <routes>
      <Home route=":locale/">
          <defaults controller="index" action="index" locale="tr_TR"/>
      </Home>
      <NewsList route=":locale/news-list/:pageID">
          <defaults controller="index" action="newsList" locale="tr_TR"/>
      </NewsList>
  </routes>
<configdata>

I think you should not use two separate routes-tags, wrap the two rules in one.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top