本文整理匯總了PHP中Piwik\Url::getCurrentQueryString方法的典型用法代碼示例。如果您正苦於以下問題:PHP Url::getCurrentQueryString方法的具體用法?PHP Url::getCurrentQueryString怎麽用?PHP Url::getCurrentQueryString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Piwik\Url
的用法示例。
在下文中一共展示了Url::getCurrentQueryString方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
function __construct($id, $method = 'post', $attributes = null, $trackSubmit = false)
{
if (!isset($attributes['action'])) {
$attributes['action'] = Url::getCurrentQueryString();
}
if (!isset($attributes['name'])) {
$attributes['name'] = $id;
}
parent::__construct($id, $method, $attributes, $trackSubmit);
$this->init();
}
示例2: testAllMethods
/**
* @group Core
*/
public function testAllMethods()
{
$this->assertEquals(Url::getCurrentQueryStringWithParametersModified(array()), Url::getCurrentQueryString());
$this->assertEquals(Url::getCurrentUrl(), Url::getCurrentUrlWithoutQueryString());
$this->assertEquals(Url::getCurrentUrl(), Url::getCurrentScheme() . '://' . Url::getCurrentHost() . Url::getCurrentScriptName());
$_SERVER['QUERY_STRING'] = 'q=test';
$parameters = array_keys(Url::getArrayFromCurrentQueryString());
$parametersNameToValue = array();
foreach ($parameters as $name) {
$parametersNameToValue[$name] = null;
}
$this->assertEquals('', Url::getCurrentQueryStringWithParametersModified($parametersNameToValue));
}
示例3: checkForceSslLogin
/**
* Check force_ssl_login and redirect if connection isn't secure and not using a reverse proxy
*
* @param none
* @return void
*/
protected function checkForceSslLogin()
{
$forceSslLogin = Config::getInstance()->General['force_ssl_login'];
if ($forceSslLogin && !ProxyHttp::isHttps()) {
$url = 'https://' . Url::getCurrentHost() . Url::getCurrentScriptName() . Url::getCurrentQueryString();
Url::redirectToUrl($url);
}
}