当前位置: 首页>>代码示例>>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;未经允许,请勿转载。