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


PHP Url::getArrayFromCurrentQueryString方法代码示例

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


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

示例1: 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));
 }
开发者ID:FluentDevelopment,项目名称:piwik,代码行数:16,代码来源:UrlTest.php

示例2: getQueryStringAsHash

 /**
  * We link the graph dots to the same report as currently being displayed (only the date would change).
  *
  * In some cases the widget is loaded within a report that doesn't exist as such.
  * For example, the dashboards loads the 'Last visits graph' widget which can't be directly linked to.
  * Instead, the graph must link back to the dashboard.
  *
  * In other cases, like Visitors>Overview or the Goals graphs, we can link the graph clicks to the same report.
  *
  * To detect whether or not we can link to a report, we simply check if the current URL from which it was loaded
  * belongs to the menu or not. If it doesn't belong to the menu, we do not append the hash to the URL,
  * which results in loading the dashboard.
  *
  * @return array Query string array to append to the URL hash or false if the dashboard should be displayed
  */
 private function getQueryStringAsHash()
 {
     $queryString = Url::getArrayFromCurrentQueryString();
     $piwikParameters = array('idSite', 'date', 'period', 'XDEBUG_SESSION_START', 'KEY');
     foreach ($piwikParameters as $parameter) {
         unset($queryString[$parameter]);
     }
     if (MenuMain::getInstance()->isUrlFound($queryString)) {
         return $queryString;
     }
     return false;
 }
开发者ID:brienomatty,项目名称:elmsln,代码行数:27,代码来源:Evolution.php


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