Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

How to route: http://dmoain/module/controller/action.html/en



2.4k
edited Apr '15

Try this:

$router->add('/:module/:controller/([a-z]+)\.(json|html)/([a-z]{2})', array(
    'module' => 1,
    'controller' => 2,
    'action' => 3,
    'type' => 4,
    'country' => 5
));

Hi, i did that, and works!, but i have a problem!... this is url:

http://feedback/public/common/changelanguage.html/en

and in the controller:

public function changeLanguageAction($lang = NULL) {
    echo $lang;
    die();
    $this->view->disable();
    $this->_fnChangeLanguage($lang);
}

echo $lang: must be: en but show: n

Help!



13.2k
Accepted
answer

I fixed muy problem!....

http://feedback/public/common/changelanguage.html/parameters

http://feedback/public/common/changelanguage.html/en

http://feedback/public/common/changelanguage.html/etc

    $router->add('/:module/:controller/([a-z]+)\.(json|html)/:params', array(
    'module' => 1,
    'controller' => 2,
    'action' => 3,
    'type' => 4,
    'params' => 5
));