當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。