views:

56

answers:

1

Hello,

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

+2  A: 
<?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.

The Guy Of Doom
Thank you, it worked! I can't believe I did this mistake.
Gökçen Öğütçü