Hello,

Thanks for your reply... I will test all the code...

So, it is true is not working the way i said ?

I mean with subclassing Route class for putting new self::URI_DELIMITER in place and :description_:controller_:action_* wont't work ? Much easier to handle through a single router...

Anyway, your sample is a good solution. Starting to check ;)

--
Best regards,
Cristian Bichis
www.zftutorials.com <http://www.zftutorials.com> | www.zfforums.com <http://www.zfforums.com> | www.zflinks.com <http://www.zflinks.com>

Try using the new Regex route:

    $route = new Zend_Controller_Router_Route_Regex(
        '([^_]*)_([^_]*)_([^_]*)_(.*)',
        null,
        array(
            1 => 'description',
            2 => 'controller',
            3 => 'action',
            4 => 'paramsSegment'
        )
    );
    $router->add('seoFriendly', $route);

You'll need to grab the parameters yourself and split them in your code:

    $paramsSegment = $this->_getParam('paramsSegment', '');
    $paramsArray   = (explode('_', $paramsSegment);
    $count         = count($paramsArray);
    $params        = array();
    for ($i = 0; $i < $count; $i = $i + 2) {
        if (isset($paramsArray[$i + 1])) {
            $params[urldecode($paramsArray[$i])] = urldecode($paramsArray[$i + 
1]);
        } else {
            $params[urldecode($paramsArray[$i])] = null;
        }
    }
However, this route will grab the various segments and assign them to
the variables you desire.


<http://www.zflinks.com>

Reply via email to