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


PHP URI::uri方法代码示例

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


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

示例1: strip_one_time_params

	/**
	 * remove the one time GET parameters from further URIs
	 *
	 * @param array   $keys one time parameters
	 */
	public static function strip_one_time_params(array $keys) {
		foreach ( $keys as $key ) {
			if (isset(self::$query[$key])) unset(self::$query[$key]);
		}
		// if all elements are unset, the array behaves not as an array anymore
		if (!count(self::$query)) self::$query = array();
		self::$uri = self::build(self::$query);
	}
开发者ID:ppschweiz,项目名称:basisentscheid,代码行数:13,代码来源:URI.php

示例2: current

 public static function current()
 {
     if (!is_null(self::$uri)) {
         return self::$uri;
     }
     $uri = trim(Request::pathInfo(), "/");
     $uri = $uri ? $uri : "/";
     self::$uri = $uri;
     $segments = array_diff(explode("/", trim($uri, "/")), array(""));
     if (array_get($segments, 0) == "manager") {
         self::$isManager = true;
         array_shift($segments);
     }
     self::$segments = $segments;
     return $uri;
 }
开发者ID:jura-php,项目名称:jura,代码行数:16,代码来源:URI.php

示例3: testToLanguageMethodGeneratesURLsToDifferentLanguage

 /**
  * Test the URL::to_language method.
  *
  * @group laravel
  */
 public function testToLanguageMethodGeneratesURLsToDifferentLanguage()
 {
     URI::$uri = 'foo/bar';
     Config::set('application.languages', array('sp', 'fr'));
     Config::set('application.language', 'sp');
     $this->assertEquals('http://localhost/index.php/fr/foo/bar', URL::to_language('fr'));
     $this->assertEquals('http://localhost/index.php/fr/', URL::to_language('fr', true));
     Config::set('application.index', '');
     $this->assertEquals('http://localhost/fr/foo/bar', URL::to_language('fr'));
     $this->assertEquals('http://localhost/sp/foo/bar', URL::to_language('en'));
 }
开发者ID:gigikiri,项目名称:masjid-l3,代码行数:16,代码来源:url.test.php

示例4: trim

| If the URI starts with one of the supported languages, we will set
| the default lagnauge to match that URI segment and shorten the
| URI we'll pass to the router to not include the lang segment.
|
*/
foreach ($languages as $language) {
    if (starts_with($uri, $language)) {
        Config::set('application.language', $language);
        $uri = trim(substr($uri, strlen($language)), '/');
        break;
    }
}
if ($uri == '') {
    $uri = '/';
}
URI::$uri = $uri;
/*
|--------------------------------------------------------------------------
| Route The Incoming Request
|--------------------------------------------------------------------------
|
| Phew! We can finally route the request to the appropriate route and
| execute the route to get the response. This will give an instance
| of the Response object that we can send back to the browser
|
*/
Request::$route = Routing\Router::route(Request::method(), $uri);
$response = Request::$route->call();
/*
|--------------------------------------------------------------------------
| "Render" The Response
开发者ID:nedf23,项目名称:url_shortener,代码行数:31,代码来源:laravel.php

示例5: tearDown

 /**
  * Destroy the test environment.
  */
 public function tearDown()
 {
     $_SERVER = array();
     URI::$uri = null;
     URI::$segments = array();
 }
开发者ID:gilyaev,项目名称:framework-bench,代码行数:9,代码来源:uri.test.php


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