initViewer example

private function initViewer(): void
    {
        $this->viewer ??= Services::renderer();
    }

    /** * Child classes should implement this to return the timeline data * formatted for correct usage. */
    protected function formatTimelineData(): array
    {
        $this->initViewer();

        $data = [];

        $rows = $this->viewer->getPerformanceData();

        foreach ($rows as $info) {
            $data[] = [
                'name'      => 'View: ' . $info['view'],
                'component' => 'Views',
                'start'     => $info['start'],
                'duration'  => $info['end'] - $info['start'],
            ];
Home | Imprint | This part of the site doesn't use cookies.