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


PHP Request::getBaseReportUrl方法代码示例

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


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

示例1: addRelatedReport

 /**
  * Adds a related report to the {@link $related_reports} property. If the report
  * references the one that is currently being displayed, it will not be added to the related
  * report list.
  *
  * @param string $relatedReport The plugin and method of the report, eg, `'DevicesDetection.getBrowsers'`.
  * @param string $title The report's display name, eg, `'Browsers'`.
  * @param array $queryParams Any extra query parameters to set in releated report's URL, eg,
  *                           `array('idGoal' => 'ecommerceOrder')`.
  */
 public function addRelatedReport($relatedReport, $title, $queryParams = array())
 {
     list($module, $action) = explode('.', $relatedReport);
     // don't add the related report if it references this report
     if ($this->controllerName == $module && $this->controllerAction == $action) {
         if (empty($queryParams)) {
             return;
         }
     }
     $url = ApiRequest::getBaseReportUrl($module, $action, $queryParams);
     $this->related_reports[$url] = $title;
 }
开发者ID:GovanifY,项目名称:piwik,代码行数:22,代码来源:Config.php

示例2: __construct

 /**
  * Constructor. Initializes display and request properties to their default values.
  * Posts the {@hook ViewDataTable.configure} event which plugins can use to configure the
  * way reports are displayed.
  */
 public function __construct($controllerAction, $apiMethodToRequestDataTable, $overrideParams = array())
 {
     list($controllerName, $controllerAction) = explode('.', $controllerAction);
     $this->requestConfig = static::getDefaultRequestConfig();
     $this->config = static::getDefaultConfig();
     $this->config->subtable_controller_action = $controllerAction;
     $this->config->setController($controllerName, $controllerAction);
     $this->request = new ViewDataTableRequest($this->requestConfig);
     $this->requestConfig->idSubtable = Common::getRequestVar('idSubtable', false, 'int');
     $this->config->self_url = Request::getBaseReportUrl($controllerName, $controllerAction);
     $this->requestConfig->apiMethodToRequestDataTable = $apiMethodToRequestDataTable;
     $report = Report::factory($this->requestConfig->getApiModuleToRequest(), $this->requestConfig->getApiMethodToRequest());
     if (!empty($report)) {
         /** @var Report $report */
         $subtable = $report->getActionToLoadSubTables();
         if (!empty($subtable)) {
             $this->config->subtable_controller_action = $subtable;
         }
         $this->config->show_goals = $report->hasGoalMetrics();
         $relatedReports = $report->getRelatedReports();
         if (!empty($relatedReports)) {
             foreach ($relatedReports as $relatedReport) {
                 $widgetTitle = $relatedReport->getWidgetTitle();
                 if ($widgetTitle && Common::getRequestVar('widget', 0, 'int')) {
                     $relatedReportName = $widgetTitle;
                 } else {
                     $relatedReportName = $relatedReport->getName();
                 }
                 $this->config->addRelatedReport($relatedReport->getModule() . '.' . $relatedReport->getAction(), $relatedReportName);
             }
         }
         $metrics = $report->getMetrics();
         if (!empty($metrics)) {
             $this->config->addTranslations($metrics);
         }
         $processedMetrics = $report->getProcessedMetrics();
         if (!empty($processedMetrics)) {
             $this->config->addTranslations($processedMetrics);
         }
         $report->configureView($this);
     }
     /**
      * Triggered during {@link ViewDataTable} construction. Subscribers should customize
      * the view based on the report that is being displayed.
      *
      * Plugins that define their own reports must subscribe to this event in order to
      * specify how the Piwik UI should display the report.
      *
      * **Example**
      *
      *     // event handler
      *     public function configureViewDataTable(ViewDataTable $view)
      *     {
      *         switch ($view->requestConfig->apiMethodToRequestDataTable) {
      *             case 'VisitTime.getVisitInformationPerServerTime':
      *                 $view->config->enable_sort = true;
      *                 $view->requestConfig->filter_limit = 10;
      *                 break;
      *         }
      *     }
      *
      * @param ViewDataTable $view The instance to configure.
      */
     Piwik::postEvent('ViewDataTable.configure', array($this));
     $this->assignRelatedReportsTitle();
     $this->config->show_footer_icons = false == $this->requestConfig->idSubtable;
     // the exclude low population threshold value is sometimes obtained by requesting data.
     // to avoid issuing unecessary requests when display properties are determined by metadata,
     // we allow it to be a closure.
     if (isset($this->requestConfig->filter_excludelowpop_value) && $this->requestConfig->filter_excludelowpop_value instanceof \Closure) {
         $function = $this->requestConfig->filter_excludelowpop_value;
         $this->requestConfig->filter_excludelowpop_value = $function();
     }
     $this->overrideViewPropertiesWithParams($overrideParams);
     $this->overrideViewPropertiesWithQueryParams();
 }
开发者ID:hichnik,项目名称:piwik,代码行数:81,代码来源:ViewDataTable.php

示例3: __construct

 /**
  * Constructor. Initializes display and request properties to their default values.
  * Posts the {@hook ViewDataTable.configure} event which plugins can use to configure the
  * way reports are displayed.
  */
 public function __construct($controllerAction, $apiMethodToRequestDataTable)
 {
     list($controllerName, $controllerAction) = explode('.', $controllerAction);
     $this->requestConfig = static::getDefaultRequestConfig();
     $this->config = static::getDefaultConfig();
     $this->config->subtable_controller_action = $controllerAction;
     $this->config->setController($controllerName, $controllerAction);
     $this->request = new ViewDataTableRequest($this->requestConfig);
     $this->requestConfig->idSubtable = Common::getRequestVar('idSubtable', false, 'int');
     $this->config->self_url = Request::getBaseReportUrl($controllerName, $controllerAction);
     $this->requestConfig->apiMethodToRequestDataTable = $apiMethodToRequestDataTable;
     /**
      * Triggered during {@link ViewDataTable} construction. Subscribers should customize
      * the view based on the report that is being displayed.
      * 
      * Plugins that define their own reports must subscribe to this event in order to
      * specify how the Piwik UI should display the report.
      * 
      * **Example**
      *
      *     // event handler
      *     public function configureViewDataTable(ViewDataTable $view)
      *     {
      *         switch ($view->requestConfig->apiMethodToRequestDataTable) {
      *             case 'VisitTime.getVisitInformationPerServerTime':
      *                 $view->config->enable_sort = true;
      *                 $view->requestConfig->filter_limit = 10;
      *                 break;
      *         }
      *     }
      * 
      * @param ViewDataTable $view The instance to configure.
      */
     Piwik::postEvent('ViewDataTable.configure', array($this));
     $this->config->show_footer_icons = false == $this->requestConfig->idSubtable;
     // the exclude low population threshold value is sometimes obtained by requesting data.
     // to avoid issuing unecessary requests when display properties are determined by metadata,
     // we allow it to be a closure.
     if (isset($this->requestConfig->filter_excludelowpop_value) && $this->requestConfig->filter_excludelowpop_value instanceof \Closure) {
         $function = $this->requestConfig->filter_excludelowpop_value;
         $this->requestConfig->filter_excludelowpop_value = $function();
     }
     $this->overrideViewPropertiesWithQueryParams();
 }
开发者ID:KiwiJuicer,项目名称:handball-dachau,代码行数:49,代码来源:ViewDataTable.php


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