public function buildUrl($param = null, $value = null, $separator = '&amp;')
    {
        if (!is_array($param) && !empty($value)) {
            $param = array( $param=>$value );
        }

        $default_args = array(
            'controller' => CarteBlanche::getConfig('routing.mvc.default_controller'),
            'action' => CarteBlanche::getConfig('routing.mvc.default_action')
        );
        if (!empty($param)) {
            foreach ($param as $_var=>$_val) {
                if (!empty($_val)) {
                    $_meth = 'fromUrl'.TextHelper::toCamelCase($_var);
                    if (method_exists($this, $_meth)) {
                        $_val = call_user_func_array(array($this, $_meth), array($_val));
                    }
                    if (array_key_exists($_var, $default_args) && (
                        $_val===$default_args[$_var] || strtolower($_val)===$default_args[$_var] || parent::urlEncode($_val)===$default_args[$_var]
                    )) {
                        unset($param[$_var]);
                    }
                }
            }
        }

        return parent::generateUrl($param, CarteBlanche::getPath('root_file'), '', $separator);
    }
public function buildUrl($param = null, $value = null, $separator = '&amp;')
    {
        if (!is_array($param) && !empty($value)) {
            $param = array( $param=>$value );
        }

        $default_args = array(
            'controller' => CarteBlanche::getConfig('routing.mvc.default_controller'),
            'action' => CarteBlanche::getConfig('routing.mvc.default_action')
        );
        if (!empty($param)) {
            foreach ($param as $_var=>$_val) {
                if (!empty($_val)) {
                    $_meth = 'fromUrl'.TextHelper::toCamelCase($_var);
                    if (method_exists($this, $_meth)) {
                        $_val = call_user_func_array(array($this, $_meth), array($_val));
                    }
                    if (array_key_exists($_var, $default_args) && (
                        $_val===$default_args[$_var] || strtolower($_val)===$default_args[$_var] || parent::urlEncode($_val)===$default_args[$_var]
                    )) {
                        unset($param[$_var]);
                    }
                }
            }
        }

        return parent::generateUrl($param, CarteBlanche::getPath('root_file'), '', $separator);
    }
public function buildUrl ( $ param = null , $ value = null , $ separator = '&amp;' ) { if ( ! is_array ( $ param ) && ! empty ( $ value ) ) { $ param = array ( $ param => $ value ) ; } $ default_args = array ( 'controller' => CarteBlanche :: getConfig ( 'routing.mvc.default_controller' ) , 'action' => CarteBlanche :: getConfig ( 'routing.mvc.default_action' ) ) ; if ( ! empty ( $ param ) ) { foreach ( $ param as $ _var => $ _val ) { if ( ! empty ( $ _val ) ) { $ _meth = 'fromUrl' . TextHelper :: toCamelCase ( $ _var ) ; if ( method_exists ( $ this , $ _meth ) ) { $ _val = call_user_func_array ( array ( $ this , $ _meth ) , array ( $ _val ) ) ; } if ( array_key_exists ( $ _var , $ default_args ) && ( $ _val === $ default_args [ $ _var ] || strtolower ( $ _val ) === $ default_args [ $ _var ] || parent :: urlEncode ( $ _val ) === $ default_args [ $ _var ] ) ) { unset ( $ param [ $ _var ] ) ; } } } } return parent :: generateUrl ( $ param , CarteBlanche :: getPath ( 'root_file' ) , '' , $ separator ) ; }
Build an application URL with a set of arguments

The class will pass arguments values to any `$this->toUrlParam($value)` method for the
parameter named `param`.

@param string/array $param The parameter name if it's single, an array of parameters and their values otherwise
@param string $value The value for the parameter if it's single
@param string $separator The argument/value separator (default is escaped ampersand : '&amp;')
@return string The URL built
Build an application URL with a set of arguments