‪TYPO3CMS  10.4
NumberWithIconWidget.php
Go to the documentation of this file.
1 <?php
2 
3 declare(strict_types=1);
4 
5 /*
6  * This file is part of the TYPO3 CMS project.
7  *
8  * It is free software; you can redistribute it and/or modify it under
9  * the terms of the GNU General Public License, either version 2
10  * of the License, or any later version.
11  *
12  * For the full copyright and license information, please read the
13  * LICENSE.txt file that was distributed with this source code.
14  *
15  * The TYPO3 project - inspiring people to share!
16  */
17 
19 
21 
41 {
45  private ‪$configuration;
49  private ‪$view;
53  private ‪$options;
57  private ‪$dataProvider;
58 
59  public function ‪__construct(
63  array ‪$options = []
64  ) {
65  $this->configuration = ‪$configuration;
66  $this->view = ‪$view;
67  $this->options = ‪$options;
68  $this->dataProvider = ‪$dataProvider;
69  }
70 
74  public function ‪renderWidgetContent(): string
75  {
76  $this->view->setTemplate('Widget/NumberWithIconWidget');
77  $this->view->assignMultiple([
78  'icon' => $this->options['icon'],
79  'title' => $this->options['title'],
80  'subtitle' => $this->options['subtitle'],
81  'number' => $this->dataProvider->getNumber(),
82  'options' => $this->options,
83  'configuration' => $this->configuration
84  ]);
85  return $this->view->render();
86  }
87 }
‪TYPO3\CMS\Dashboard\Widgets\NumberWithIconDataProviderInterface
Definition: NumberWithIconDataProviderInterface.php:24
‪TYPO3\CMS\Dashboard\Widgets\WidgetInterface
Definition: WidgetInterface.php:26
‪TYPO3\CMS\Dashboard\Widgets\NumberWithIconWidget\$dataProvider
‪NumberWithIconDataProviderInterface $dataProvider
Definition: NumberWithIconWidget.php:53
‪TYPO3\CMS\Dashboard\Widgets\NumberWithIconWidget\renderWidgetContent
‪renderWidgetContent()
Definition: NumberWithIconWidget.php:70
‪TYPO3\CMS\Dashboard\Widgets\NumberWithIconWidget\$options
‪array $options
Definition: NumberWithIconWidget.php:50
‪TYPO3\CMS\Dashboard\Widgets\NumberWithIconWidget\$configuration
‪WidgetConfigurationInterface $configuration
Definition: NumberWithIconWidget.php:44
‪TYPO3\CMS\Dashboard\Widgets\NumberWithIconWidget
Definition: NumberWithIconWidget.php:41
‪TYPO3\CMS\Dashboard\Widgets\NumberWithIconWidget\__construct
‪__construct(WidgetConfigurationInterface $configuration, NumberWithIconDataProviderInterface $dataProvider, StandaloneView $view, array $options=[])
Definition: NumberWithIconWidget.php:55
‪TYPO3\CMS\Dashboard\Widgets\NumberWithIconWidget\$view
‪StandaloneView $view
Definition: NumberWithIconWidget.php:47
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:34
‪TYPO3\CMS\Dashboard\Widgets
Definition: AdditionalCssInterface.php:18
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface
Definition: WidgetConfigurationInterface.php:26