Example #1
0
 /**
  * Intercepts the parent url function to first look if the cache was already generated for the same params
  *
  * @param mixed $url url to generate using cakephp array syntax
  * @param boolean $full wheter to generate a full url or not (http scheme)
  * @return string
  * @see Helper::url()
  */
 function url($url = null, $full = false)
 {
     if (Configure::read('UrlCache.active')) {
         if ($cachedUrl = UrlCacheManager::get($url, $full)) {
             return $cachedUrl;
         }
     }
     $routerUrl = h(Router::url($url, $full));
     if (Configure::read('UrlCache.active')) {
         UrlCacheManager::set($routerUrl);
     }
     return $routerUrl;
 }
 /**
  * Intercepts the parent URL function to first look if the cache was already generated for the same params
  *
  * @param mixed $url URL to generate using CakePHP array syntax
  * @param boolean $full whether to generate a full url or not (http scheme)
  * @return string
  * @see Helper::url()
  */
 public function url($url = null, $full = false)
 {
     if (Configure::read('UrlCache.runtime.afterLayout')) {
         return parent::url($url, $full);
     }
     if (Configure::read('UrlCache.active')) {
         if ($cachedUrl = UrlCacheManager::get($url, $full)) {
             return $cachedUrl;
         }
     }
     $routerUrl = parent::url($url, $full);
     if (Configure::read('UrlCache.active')) {
         UrlCacheManager::set($routerUrl);
     }
     return $routerUrl;
 }
Example #3
0
 /**
  * Intercepts the parent url function to first look if the cache was already generated for the same params
  *
  * @param mixed $url url to generate using cakephp array syntax
  * @param bool|array $full whether to generate a full url or not (http scheme). As array: full, escape.
  * @return string
  * @see Helper::url()
  */
 public function url($url = null, $full = false)
 {
     if (is_array($full)) {
         $escape = isset($full['ecape']) ? $full['escape'] : true;
         $full = isset($full['full']) ? $full['full'] : false;
     } else {
         $escape = true;
     }
     if (Configure::read('UrlCache.active')) {
         if ($cachedUrl = UrlCacheManager::get($url, $full)) {
             return $cachedUrl;
         }
     }
     if (!$escape) {
         $routerUrl = Router::url($url, $full);
     } else {
         $routerUrl = parent::url($url, $full);
     }
     if (Configure::read('UrlCache.active')) {
         UrlCacheManager::set($routerUrl);
     }
     return $routerUrl;
 }