0

we have used kohana 3.2. We need to changed the url xyz.com/ar measn the site working arabic lanugag and xyz.com/en means the site working in english language. Now the default 3 param is id. I need to changes this.

  Route::set('custom', '(<controller>(/<action>(/<id>)))')
        ->defaults(array(
            'controller' => 'admin',
            'action'     => 'index',
    ));
    Route::set('live', 'ar/auctions/live')
    ->defaults(array('controller' => 'auctions','action'  => 'closed','method' => NULL));
arulraj
  • 105
  • 2
  • 12

1 Answers1

0

1 Route::set() have 3 parametrs. Last is Regex patterns for route keys

2 The sequence is important, so first live, second custom

3 Try this:

Route::set('other', '((<lang>)(/)(<controller>(/<action>(/<id>))))', 
                     Array('lang'=>'(en|ar)'))->defaults(array(
    'lang'       => $default_lang,
    'controller' => 'foo',
    'action'     => 'index',
));

I18n::lang(Request::instance()->param('lang'));
bato3
  • 2,695
  • 1
  • 18
  • 26