当前位置: 首页>>代码示例>>PHP>>正文


PHP AppHelper::url方法代码示例

本文整理汇总了PHP中AppHelper::url方法的典型用法代码示例。如果您正苦于以下问题:PHP AppHelper::url方法的具体用法?PHP AppHelper::url怎么用?PHP AppHelper::url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在AppHelper的用法示例。


在下文中一共展示了AppHelper::url方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionUrl

 public function actionUrl($action, $dir = null, $file = null, $full = false)
 {
     $url = array('plugin' => 'media', 'controller' => 'file_explorer', 'action' => $action, 'config' => $this->settings['config']);
     $url = parent::url($url, $full);
     //$dir = urlencode($dir);
     //$file = urlencode($file);
     $url .= '?' . http_build_query(compact('dir', 'file'));
     return $url;
 }
开发者ID:fm-labs,项目名称:cakephp-media,代码行数:9,代码来源:FileExplorerHelper.php

示例2: url

 public function url($data, $fieldName, $full = false)
 {
     $this->setEntity($fieldName);
     if (isset($data[$this->model()])) {
         $data = $data[$this->model()];
     }
     $path = $this->_path();
     $dir = $this->_dir($data);
     $filename = $this->_filename($data);
     $Model = ClassRegistry::init($this->model());
     $filePath = ROOT . DS . APP_DIR . DS . str_replace('/', DS, "/{$path}{$dir}/{$filename}");
     if (!file_exists($filePath) && !empty($data[$Model->primaryKey])) {
         $Model->id = $data[$Model->primaryKey];
         $Model->createThumbnail($this->field(), $this->_style());
     }
     if (substr($path, 0, 8) == 'webroot/') {
         $path = substr($path, 8);
     }
     return parent::url($this->webroot("/{$path}{$dir}/{$filename}"), $full);
 }
开发者ID:rodrigorm,项目名称:upload,代码行数:20,代码来源:upload.php

示例3: url

 /**
  * Merges passed URL options with current pagination state to generate a pagination URL.
  *
  * @param  array $options Pagination/URL options array
  * @param  boolean $asArray
  * @param  string $model Which model to paginate on
  * @return mixed By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript)
  */
 function url($options = array(), $asArray = false, $model = null)
 {
     $paging = $this->params($model);
     if (!empty($paging['defaults'])) {
         $url = array_merge(array_filter(Set::diff(array_merge($paging['defaults'], $paging['options']), [])), $options);
     } else {
         $url = array_merge(array_filter(Set::diff(array_merge([], $paging['options']), [])), $options);
     }
     if (isset($url['order'])) {
         $sort = $direction = null;
         if (is_array($url['order'])) {
             list($sort, $direction) = array($this->sortKey($model, $url), current($url['order']));
         }
         unset($url['order']);
         $url = array_merge($url, compact('sort', 'direction'));
     }
     if ($asArray) {
         return $url;
     }
     return parent::url($url);
 }
开发者ID:sgh1986915,项目名称:cakephp2-bpong,代码行数:29,代码来源:PaginatorHelper.php

示例4: url

 /**
  * Merges passed URL options with current pagination state to generate a pagination URL.
  *
  * @param  array $options Pagination/URL options array
  * @param  boolean $asArray
  * @param  string $model Which model to paginate on
  * @return mixed By default, returns a full pagination URL string for use in non-standard contexts (i.e. JavaScript)
  */
 function url($options = array(), $asArray = false, $model = null)
 {
     $paging = $this->params($model);
     $url = array_merge(array_filter(Set::diff(array_merge($paging['defaults'], $paging['options']), $paging['defaults'])), $options);
     if (isset($url['order'])) {
         $sort = $direction = null;
         if (is_array($url['order'])) {
             list($sort, $direction) = array($this->sortKey($model, $url), current($url['order']));
             $key = array_keys($url['order']);
             if (strpos($key[0], '.') !== false) {
                 list($model) = explode('.', $key[0]);
                 $sort = $model . '.' . $sort;
             }
         }
         unset($url['order']);
         $url = array_merge($url, compact('sort', 'direction'));
     }
     if ($asArray) {
         return $url;
     }
     return parent::url($url);
 }
开发者ID:quanganhdo,项目名称:undistractify,代码行数:30,代码来源:paginator.php

示例5: url

 /**
  * Convenience method to generate url to a node or current node
  *
  * @param array $node Node data
  * @return string
  */
 public function url($url = null, $full = false)
 {
     if ($url === null && $this->node) {
         $url = $this->node;
     }
     $alias = is_array($url) ? key($url) : null;
     if (isset($url[$alias]['url'])) {
         $url = $url[$alias]['url'];
     } elseif (isset($url[$alias]['type']) && isset($url[$alias]['slug'])) {
         $url = array('plugin' => 'nodes', 'controller' => 'nodes', 'action' => 'view', 'type' => $url[$alias]['type'], 'slug' => $url[$alias]['slug']);
     }
     return parent::url($url, $full);
 }
开发者ID:saydulk,项目名称:croogo,代码行数:19,代码来源:NodesHelper.php

示例6: testFullUrlWithRequestParams

 public function testFullUrlWithRequestParams()
 {
     $this->AppHelper->request->params['locale'] = 'por';
     $url = $this->AppHelper->url(null, true);
     $this->assertEqual($url, Router::url('/por/index', true));
 }
开发者ID:saydulk,项目名称:croogo,代码行数:6,代码来源:CroogoAppHelperTest.php

示例7: url

 /**
  * Merges passed URL options with current pagination state to generate a pagination URL.
  *
  * @param array $options Pagination/URL options array
  * @param boolean $asArray Return the URL as an array, or a URI string
  * @param string $model Which model to paginate on
  * @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)
 {
     $paging = $this->params($model);
     $url = array_merge(array_filter($paging['options']), $options);
     if (isset($url['order'])) {
         $sort = $direction = null;
         if (is_array($url['order'])) {
             list($sort, $direction) = array($this->sortKey($model, $url), current($url['order']));
         }
         unset($url['order']);
         $url = array_merge($url, compact('sort', 'direction'));
     }
     $url = $this->_convertUrlKeys($url, $paging['paramType']);
     if (!empty($url['page']) && $url['page'] == 1) {
         $url['page'] = null;
     }
     if (!empty($url['?']['page']) && $url['?']['page'] == 1) {
         unset($url['?']['page']);
     }
     if ($asArray) {
         return $url;
     }
     return parent::url($url);
 }
开发者ID:victormalaca,项目名称:acaimaissabor,代码行数:33,代码来源:PaginatorHelper.php

示例8: url

 /**
  * Turns a file path into a (routed) URL
  *
  * Reimplemented method from Helper
  *
  * @param string $path Absolute or partial path to a file
  * @param boolean $full
  * @return string
  */
 function url($path = null, $full = false)
 {
     if (is_array($path) || strpos($path, '://') !== false) {
         return parent::url($path, $full);
     }
     if (!($path = $this->webroot($path))) {
         return null;
     }
     return $full ? FULL_BASE_URL . $path : $path;
 }
开发者ID:essemme,项目名称:media,代码行数:19,代码来源:medium.php

示例9: wsdlUrl

 /**
  * Return the url to the wsdl file.
  *
  * @return string
  */
 public function wsdlUrl()
 {
     return AppHelper::url(array('controller' => Inflector::underscore($this->controller->name), 'action' => $this->__settings['wsdlAction'], $this->__settings['prefix'] => true), true);
 }
开发者ID:hobbysh,项目名称:seevia-opensource,代码行数:9,代码来源:soap.php

示例10: getUrl

 /**
  * ベースを考慮したURLを取得
  * 
  * @param string $url
  * @param boolean $full
  */
 function getUrl($url, $full = false)
 {
     return parent::url($url, $full);
 }
开发者ID:nazo,项目名称:phpcondo,代码行数:10,代码来源:baser.php

示例11: getUrl

 /**
  * baserCMSの設置フォルダを考慮したURLを取得する
  * 
  * 《利用例》
  * <a href="<?php echo $this->BcBaser->getUrl('/about') ?>">会社概要</a>
  *
  * @param mixed $url baserCMS設置フォルダからの絶対URL、もしくは配列形式のURL情報
  *		省略した場合には、PC用のトップページのURLを取得する
  * @param bool $full httpから始まるURLを取得するかどうか
  * @param bool $sessionId セションIDを付加するかどうか
  * @return string URL
  */
 public function getUrl($url = null, $full = false, $sessionId = true)
 {
     return parent::url($url, $full, $sessionId);
 }
开发者ID:naow9y,项目名称:basercms,代码行数:16,代码来源:BcBaserHelper.php

示例12: url

 /**
  * Turns a file path into a (routed) URL
  *
  * Reimplemented method from Helper
  *
  * @param string $path Absolute or partial path to a file
  * @param boolean $full
  * @return string
  */
 function url($path = null, $full = false)
 {
     return parent::url($this->webroot($path), $full);
 }
开发者ID:redlion09,项目名称:ems-1,代码行数:13,代码来源:media.php


注:本文中的AppHelper::url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。