Hi Marco,

I got an solution now. This is my route in
/module/Application/config/module.config.php:

------------------------------------------------------------------------
'application' => array(
    'type'    => 'segment',
    'options' => array(
        'route'    => '/[:lang][/:controller][/:action][/:id]',
        'constraints' => array(
            'lang'       => '[a-z]{2}',
            'controller' => '[a-zA-Z][a-zA-Z0-9_-]*',
            'action'     => '[a-zA-Z][a-zA-Z0-9_-]*',
            'id'         => '[0-9]+',
        ),
        'defaults' => array(
            'controller' => 'Application',
            'action'     => 'index',
            'lang'       => 'de',
        ),
    ),
    'may_terminate' => true,
    'child_routes' => array(
        'default' => array(
            'type'    => 'Wildcard',
            'options' => array(
            ),
        ),
    ),
),
------------------------------------------------------------------------

Then I have a couple of controllers -> invokables definitions in my
Application module and two other modules User and News:


------------------------------------------------------------------------
'controllers' => array(
    'invokables' => array(
        'Application' => 'Application\Controller\IndexController',
    ),
),

'controllers' => array(
    'invokables' => array(
        'User' => 'User\Controller\UserController',
        'UserAdmin' => 'User\Controller\AdminController',
    ),
),

'controllers' => array(
    'invokables' => array(
        'News' => 'News\Controller\NewsController',
        'NewsAdmin' => 'News\Controller\AdminController',
    ),
),
------------------------------------------------------------------------

Now al these routes work as expected:

/
/de
/de/application
/de/application/index/7
/de/application/index/7/foo/bar
/de/news
/de/news/add
/de/news/index/7/foo/bar
/de/user
/de/user-admin/index/7/foo/bar

The only problem I have is connected to the Url() View Helper. This call

   $this->url('application', array('lang' => 'de', 'action'=>'add',
                                   'controller' => 'user'))

results in an output of

   //user/add

and not as expected

   /de/user/add

What is going wrong here?

Regards,

Ralf

-- 
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]


Reply via email to