public function generateUrl($parameters, $target = null)
    {
        $parameters = $this->parametersConverter
                           ->convertServerToClientParameters($parameters);

        $parameters = $this->encodingConverter != null ? $this->encodingConverter->encodeClientUrlData($parameters) : $parameters;

        if (!is_string($target))
            $target = $this->requestParser->getRequestTarget();

        if ($parameters->offsetExists('seoPath')) {
            $seoPath = $parameters['seoPath'];
            $parameters->offsetUnset('seoPath');
            $seoPathPosition = strrpos($target, "/s/");
            if ($seoPathPosition > -1) {
                $target = substr($target, 0, $seoPathPosition);    
            }            
            $url = rtrim($target, '/') . '/s' . urldecode($seoPath) . '?' . $parameters->toPhpQueryString();
        } else {    
            $url = $target . '?' . $parameters->toPhpQueryString();
        }
        return $url;
    }