‪TYPO3CMS  10.4
CtaWidget.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 
35 {
39  private ‪$configuration;
40 
44  private ‪$view;
45 
49  private ‪$options;
50 
54  private ‪$buttonProvider;
55 
56  public function ‪__construct(
59  ‪$buttonProvider = null,
60  array ‪$options = []
61  ) {
62  $this->configuration = ‪$configuration;
63  $this->view = ‪$view;
64  $this->options = array_merge(['text' => ''], ‪$options);
65  $this->buttonProvider = ‪$buttonProvider;
66  }
67 
68  public function ‪renderWidgetContent(): string
69  {
70  $this->view->setTemplate('Widget/CtaWidget');
71  $this->view->assignMultiple([
72  'text' => $this->options['text'],
73  'options' => $this->options,
74  'button' => $this->buttonProvider,
75  'configuration' => $this->configuration
76  ]);
77  return $this->view->render();
78  }
79 }
‪TYPO3\CMS\Dashboard\Widgets\WidgetInterface
Definition: WidgetInterface.php:26
‪TYPO3\CMS\Dashboard\Widgets\CtaWidget\renderWidgetContent
‪renderWidgetContent()
Definition: CtaWidget.php:64
‪TYPO3\CMS\Dashboard\Widgets\CtaWidget\$options
‪array $options
Definition: CtaWidget.php:46
‪TYPO3\CMS\Dashboard\Widgets\CtaWidget
Definition: CtaWidget.php:35
‪TYPO3\CMS\Dashboard\Widgets\CtaWidget\$configuration
‪WidgetConfigurationInterface $configuration
Definition: CtaWidget.php:38
‪TYPO3\CMS\Dashboard\Widgets\CtaWidget\$buttonProvider
‪ButtonProviderInterface null $buttonProvider
Definition: CtaWidget.php:50
‪TYPO3\CMS\Fluid\View\StandaloneView
Definition: StandaloneView.php:34
‪TYPO3\CMS\Dashboard\Widgets\CtaWidget\__construct
‪__construct(WidgetConfigurationInterface $configuration, StandaloneView $view, $buttonProvider=null, array $options=[])
Definition: CtaWidget.php:52
‪TYPO3\CMS\Dashboard\Widgets\CtaWidget\$view
‪StandaloneView $view
Definition: CtaWidget.php:42
‪TYPO3\CMS\Dashboard\Widgets
Definition: AdditionalCssInterface.php:18
‪TYPO3\CMS\Dashboard\Widgets\ButtonProviderInterface
Definition: ButtonProviderInterface.php:24
‪TYPO3\CMS\Dashboard\Widgets\WidgetConfigurationInterface
Definition: WidgetConfigurationInterface.php:26