當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Helper::url方法代碼示例

本文整理匯總了PHP中Helper::url方法的典型用法代碼示例。如果您正苦於以下問題:PHP Helper::url方法的具體用法?PHP Helper::url怎麽用?PHP Helper::url使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Helper的用法示例。


在下文中一共展示了Helper::url方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: apiUrl

 /**
  * Convenience method to generate an API Url
  *
  * @param string|array $url
  * @param bool $full
  * @return string
  */
 public function apiUrl($url = null, $full = false)
 {
     if (is_array($url)) {
         $url = Hash::merge(array('admin' => false, 'api' => Configure::read('Croogo.Api.path'), 'prefix' => 'v1.0', 'ext' => 'json'), $url);
     }
     return parent::url($url, $full);
 }
開發者ID:saydulk,項目名稱:croogo,代碼行數:14,代碼來源:CroogoAppHelper.php

示例2: url

 public function url($url = null, $full = false)
 {
     if (is_array($url) && !array_key_exists('lang', $url)) {
         $url['lang'] = Configure::read('Config.language');
     }
     return parent::url($url, $full);
 }
開發者ID:danielhebert,項目名稱:tp3DanielHebert,代碼行數:7,代碼來源:AppHelper.php

示例3: url

 /**
  * Url helper function
  *
  * @param string $url 
  * @param bool $full 
  * @return mixed
  * @access public
  */
 public function url($url = null, $full = false)
 {
     if (!isset($url['locale']) && isset($this->params['locale'])) {
         $url['locale'] = $this->params['locale'];
     }
     return parent::url($url, $full);
 }
開發者ID:rchavik,項目名稱:indent-all-the-things,代碼行數:15,代碼來源:app_helper.php

示例4: url

 function url($url = null, $full = false)
 {
     if (isset($this->params['admin']) && is_array($url) && !isset($url['admin'])) {
         $url['admin'] = false;
     }
     return parent::url($url, $full);
 }
開發者ID:RobertWHurst,項目名稱:Telame,代碼行數:7,代碼來源:app_helper.php

示例5: url

 public function url($url = null, $full = false)
 {
     if (empty($this->params['admin']) && is_array($url) && empty($url['admin']) && !array_key_exists('lang', $url)) {
         $url['lang'] = $this->request['lang'];
     }
     return parent::url($url, $full);
 }
開發者ID:nnanna217,項目名稱:Mastering-CakePHP,代碼行數:7,代碼來源:AppHelper.php

示例6: url

 public function url($url, $full = false)
 {
     if (is_string($url) && preg_match(sprintf('/^%s.+/', preg_quote('//', '/')), $url)) {
         return h($url);
     }
     return parent::url($url, $full);
 }
開發者ID:hiromi2424,項目名稱:cake_app_base,代碼行數:7,代碼來源:app_helper.php

示例7: url

 /**
  * Url helper function
  *
  * @param string $url
  * @param bool $full
  * @return mixed
  * @access public
  */
 public function url($url = null, $full = false)
 {
     if (isset($this->request->params['locale'])) {
         if ($url === null || is_array($url) && !isset($url['locale'])) {
             $url['locale'] = $this->request->params['locale'];
         }
     }
     return parent::url($url, $full);
 }
開發者ID:Demired,項目名稱:CakeWX,代碼行數:17,代碼來源:CroogoAppHelper.php

示例8: url

 /**
  * Return link the pagination.
  * - Force return of the first page.
  *
  * @param array $options 	Opções da paginação
  * @param bool $asArray 	Retorna a url como array ou como string
  * @param string $model 	Model para paginação
  * @return mixed By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript)
  * @link http://book.cakephp.org/2.0/en/core-libraries/helpers/paginator.html#PaginatorHelper::url
  */
 public function url($options = array(), $asArray = false, $model = null)
 {
     if (is_array($options)) {
         if (!isset($options['page'])) {
             $options['page'] = 1;
         }
     }
     return parent::url($options, $asArray, $model);
 }
開發者ID:adrianodemoura,項目名稱:cakeGrid,代碼行數:19,代碼來源:AppHelper.php

示例9: url

 /**
  * Url helper function
  *
  *  - Localize URL.
  *
  * @param string $url
  * @param bool $full
  * @return mixed
  * @access public
  */
 public function url($url = null, $full = false)
 {
     if (CakePlugin::loaded('I18n')) {
         $url = Common::url($url);
         if (is_array($url) && !array_key_exists('lang', $url)) {
             $url['lang'] = Configure::read('Config.language');
         }
     }
     return parent::url($url, $full);
 }
開發者ID:gourmet,項目名稱:common,代碼行數:20,代碼來源:CommonAppHelper.php

示例10: url

 /** 
  * Overrides the default url method in order to clear any/all prefixes
  * that aren't explicitly requested. This will prevent a subsequent request
  * (e.g. redirect or link on a prefixed page) from inheriting the current
  * prefix.
  * 
  * @access  public
  * @see     Helper::url()
  */
 function url($url = null, $full = false)
 {
     if (isset($this->params['prefix'])) {
         $prefix = $this->params['prefix'];
         if ($this->params[$prefix] && (!isset($url[$prefix]) || empty($url[$prefix]))) {
             $url[$prefix] = false;
         }
     }
     return parent::url($url, $full);
 }
開發者ID:robwilkerson,項目名稱:CakePHP-Boilerplate,代碼行數:19,代碼來源:app_helper.php

示例11: getDelete

 public function getDelete($id)
 {
     DB::beginTransaction();
     try {
         $model = $this->model->find($id);
         $model->delete();
         DB::commit();
         return redirect(\Helper::url('index'))->withMessage('Data has been deleted');
     } catch (\Exception $e) {
         DB::rollback();
         return redirect(\Helper::url('index'))->withMessage('Data cannot be deleted');
     }
 }
開發者ID:julles,項目名稱:gis,代碼行數:13,代碼來源:UserController.php

示例12: url

 function url($url = null, $full = false)
 {
     $keyUrl = $url;
     if (is_array($keyUrl)) {
         $keyUrl += $this->_extras;
     }
     $key = md5(serialize($keyUrl));
     if (!empty($this->_cache[$key])) {
         return $this->_cache[$key];
     }
     $url = parent::url($url, $full);
     $this->_cache[$key] = $url;
     return $url;
 }
開發者ID:kondrat,項目名稱:agift,代碼行數:14,代碼來源:app_helper.php

示例13: url

 /**
  * url function
  *
  * @param mixed $url
  * @param bool $full
  * @access public
  * @return void
  */
 function url($url = null, $full = false)
 {
     if (!is_array($url)) {
         return parent::url($url, $full);
     }
     $defaults = array('controller' => $this->params['controller'], 'action' => $this->params['action'], 'admin' => !empty($this->params['admin']), 'lang' => $this->params['lang'], 'theme' => $this->params['theme']);
     $url = am($defaults, $url);
     if (isset($url[0])) {
         $id = Configure::read('Site.homeNode');
         if (empty($url['admin']) && $url['controller'] === 'nodes' && $url['action'] === 'view' && $url[0] == $id) {
             $url = array('action' => 'index', 'lang' => $this->params['lang'], 'theme' => $this->params['theme']);
         }
     }
     return parent::url($url, $full);
 }
開發者ID:sdoney,項目名稱:cookbook,代碼行數:23,代碼來源:app_helper.php

示例14: url

 function url($url = null, $full = false)
 {
     $keyUrl = $url;
     if (is_array($keyUrl)) {
         $keyUrl += $this->_extras;
     }
     $key = md5(serialize($keyUrl) . $full);
     $key += md5_file(CONFIGS . DS . 'routes.php');
     if (!empty($this->_cache[$key])) {
         return $this->_cache[$key];
     }
     $url = parent::url($url, $full);
     $this->_cache[$key] = $url;
     return $url;
 }
開發者ID:primeminister,項目名稱:url_cache,代碼行數:15,代碼來源:url_cache_app_helper.php

示例15: url

 /**
  * 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;
 }
開發者ID:dereuromark,項目名稱:cakephp-url-cache,代碼行數:24,代碼來源:UrlCacheAppHelper.php


注:本文中的Helper::url方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。