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


PHP uri::fromString方法代码示例

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


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

示例1: rel

 public function rel($relativeUri)
 {
     $relativeUri = $relativeUri instanceof uri ? $relativeUri : uri::fromString(strval($relativeUri));
     $rel = new uri();
     $rel->setPath(array_merge($this->_uri->getPath(), $relativeUri->getPath()));
     return $rel;
 }
开发者ID:alexqwert,项目名称:kanon,代码行数:7,代码来源:view.php

示例2: arel

 public function arel($relativeUri = '', $absolute = false, $stripLast = false)
 {
     $relativeUri = strval($relativeUri);
     //if (is_object($relativeUri))
     if (is_string($relativeUri)) {
         $relativeUri = uri::fromString($relativeUri);
     }
     $a = array();
     $rel = $this->_relativeUri->getPath();
     if ($stripLast) {
         $xrel = array_reverse($rel);
         $stripa = $relativeUri->getPath();
         foreach ($xrel as $action) {
             $stripAction = array_pop($stripa);
             if ($action != $stripAction) {
                 break;
             }
             array_pop($rel);
         }
     }
     //$relativeUri
     foreach ($rel as $action) {
         $a[] = $action;
     }
     if (!is_object($relativeUri)) {
         throw new Exception('$relativeUri not an object');
     }
     $relativeUri->setPath(array_merge($this->_baseUri->getPath(), $a, $relativeUri->getPath()));
     if ($absolute) {
         return 'http://' . request::getDomainName() . $relativeUri;
     }
     return $relativeUri;
 }
开发者ID:alexqwert,项目名称:kanon,代码行数:33,代码来源:controllerPrototype.php

示例3: wrel

 public function wrel($relativeUri = '')
 {
     $relativeUri = strval($relativeUri);
     if (is_string($relativeUri)) {
         $relativeUri = uri::fromString($relativeUri);
     }
     if (!is_object($relativeUri)) {
         throw new Exception('$relativeUri not an object');
     }
     $relativeUri->setPath(array_merge($this->_widgetUri->getPath(), $relativeUri->getPath()));
     return $relativeUri;
 }
开发者ID:alexqwert,项目名称:kanon,代码行数:12,代码来源:widgetController.php

示例4: rel

 public function rel($uri)
 {
     if (!is_object($uri)) {
         $uri = uri::fromString(strval($uri));
     }
     $rel = clone $this;
     $path = $rel->getPath();
     foreach ($uri->getPath() as $p) {
         $path[] = $p;
     }
     $rel->setPath($path);
     return $rel;
 }
开发者ID:ExceptVL,项目名称:kanon,代码行数:13,代码来源:uri.php

示例5: setRelativeUriFromBase

 public function setRelativeUriFromBase($uriString)
 {
     $baseUri = uri::fromString($uriString);
     $this->_relativeUri = uri::fromRequestUri();
     $this->_relativeUri->subtractBase($baseUri);
 }
开发者ID:alexqwert,项目名称:kanon,代码行数:6,代码来源:zenMVC.php


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