Piwik\View::singleReport PHP Méthode

singleReport() public static méthode

Can be used for pages that display only one report to avoid having to create a new template.
public static singleReport ( string $title, string $reportHtml ) : string | void
$title string The report title.
$reportHtml string The report body HTML.
Résultat string | void The report contents if `$fetch` is true.
    public static function singleReport($title, $reportHtml)
    {
        $view = new View('@CoreHome/_singleReport');
        $view->title = $title;
        $view->report = $reportHtml;
        return $view->render();
    }

Usage Example

Exemple #1
0
 public function renderReportMenu(Report $report)
 {
     Piwik::checkUserHasSomeViewAccess();
     $this->checkSitePermission();
     $report->checkIsEnabled();
     $menuTitle = $report->getMenuTitle();
     if (empty($menuTitle)) {
         throw new Exception('This report is not supposed to be displayed in the menu, please define a $menuTitle in your report.');
     }
     $menuTitle = $this->translator->translate($menuTitle);
     $content = $this->renderReportWidget($report);
     return View::singleReport($menuTitle, $content);
 }
All Usage Examples Of Piwik\View::singleReport