0

I have specific problem with Zend Framework (1.12) - url helper.

I have site, divided by languages in this form:

/en/contact /de/gallery/gal1

etc..

I have changed router to accept first parameter as variable and it's accessible by GET.

How can I set URL helper to follow this guideline and pass this variable before controller in URL ? (I'm not using modules).

Many thanks. Ivan

Ivan
  • 315
  • 1
  • 3
  • 16

1 Answers1

0

Let me reply to myself. Router setup:

  $router = $frontController->getRouter();

  $routeLang = new Zend_Controller_Router_Route(
        ':lang/:controller/:action/*',
        array(
            'lang' => 'de',
            'controller' => 'index',
            'action'    => 'index'
        ),
        array('lang' => '[a-z]{2}')
   );

  $router->addRoute('lang', $routeLang);

URL creation:

$this->url(array('lang' => 'bar', 'controller'=>'contact','action'=>'index'));

Please correct me, if my understanding is wrong.

Ivan

Ivan
  • 315
  • 1
  • 3
  • 16