Thanks mate,
I've resolved in the almost identical way without even knowing that page, I
think this confirm that this is a clever way to do this.
Here's my code
<?php
/**
* Identico all'url view helper di zend, aggiunge il quinto parametro,
* per appendere in maniera arbitraria la query string alla route
*
* @author Sergio Rinaudo
*/
class Razor_View_Helper_Url extends Zend_View_Helper_Abstract
{
/**
* Generates an url given the name of a route.
*
* @access public
*
* @param array $urlOptions Options passed to the assemble method of
the Route object.
* @param mixed $name The name of a Route to use. If null it will use
the current Route
* @param bool $reset Whether or not to reset the route defaults with
those provided
* @param bool $appendQueryString Whether or not to append the current
queryStyring
* @return string Url for the link href attribute.
*/
public function url(array $urlOptions = array(), $name = null, $reset =
false, $encode = true, $appendQueryString = false )
{
$front = Zend_Controller_Front::getInstance();
$url = $front->getRouter()->assemble($urlOptions, $name, $reset,
$encode);
$qs = $front->getRequest()->getServer( 'QUERY_STRING' );
if( $appendQueryString && !empty( $qs ) ){
$url.= "/?" . $qs;
}
return $url;
}
}
Thanks again!
Bye
--
View this message in context:
http://zend-framework-community.634137.n4.nabble.com/Appending-query-string-tp3681773p3683949.html
Sent from the Zend Framework mailing list archive at Nabble.com.
--
List: [email protected]
Info: http://framework.zend.com/archives
Unsubscribe: [email protected]