Ejemplo n.º 1
0
 /**
  * Updates values of existing url params and/or adds (if not set) those specified in $aParams
  *
  * @param String $sUrl Url
  * @param Array $aParams Array of Key-Value pairs to set url params to
  * @return  String Newly compiled url
  */
 function updateParams($sUrl, $aParams)
 {
     $aUrl = GantryUrl::explode($sUrl);
     $aUrl['query'] = '';
     $aUrl['query_params'] = array_merge($aUrl['query_params'], $aParams);
     return GantryUrl::implode($aUrl);
 }
Ejemplo n.º 2
0
 /**
  * Gets the current URL and query string and can ready it for more query string vars
  *
  * @param array $ignore
  *
  * @return mixed|string
  */
 public function getCurrentUrl($ignore = array())
 {
     gantry_import('core.utilities.gantryurl');
     $url = GantryUrl::explode($this->currentUrl);
     if (!empty($ignore) && array_key_exists('query_params', $url)) {
         foreach ($ignore as $k) {
             if (array_key_exists($k, $url['query_params'])) {
                 unset($url['query_params'][$k]);
             }
         }
     }
     return GantryUrl::implode($url);
 }