‪TYPO3CMS  ‪main
TYPO3\CMS\Dashboard\Widgets\CtaWidget Class Reference
Inheritance diagram for TYPO3\CMS\Dashboard\Widgets\CtaWidget:
TYPO3\CMS\Dashboard\Widgets\WidgetInterface TYPO3\CMS\Dashboard\Widgets\RequestAwareWidgetInterface

Public Member Functions

 __construct (private readonly WidgetConfigurationInterface $configuration, private readonly BackendViewFactory $backendViewFactory, private readonly ?ButtonProviderInterface $buttonProvider=null, array $options=[],)
 
 setRequest (ServerRequestInterface $request)
 
 renderWidgetContent ()
 
 getOptions ()
 

Private Attributes

readonly array $options
 
ServerRequestInterface $request
 

Detailed Description

Concrete CTA button implementation

Shows a widget with a CTA button to easily go to a specific page or do a specific action. You can add a button to the widget by defining a button provider.

The following options are available during registration:

  • ‪text string Adds a text to the widget to give some more background information about what a user can expect when clicking the button. You can either enter a normal string or a translation string (eg. LLL:EXT:dashboard/Resources/Private/Language/locallang.xlf:widgets.documentation.gettingStarted.text)
    See also
    ButtonProviderInterface

Definition at line 35 of file CtaWidget.php.

Constructor & Destructor Documentation

◆ __construct()

TYPO3\CMS\Dashboard\Widgets\CtaWidget::__construct ( private readonly WidgetConfigurationInterface  $configuration,
private readonly BackendViewFactory  $backendViewFactory,
private readonly ?ButtonProviderInterface  $buttonProvider = null,
array  $options = [] 
)

Definition at line 43 of file CtaWidget.php.

References TYPO3\CMS\Dashboard\Widgets\CtaWidget\$options.

Member Function Documentation

◆ getOptions()

TYPO3\CMS\Dashboard\Widgets\CtaWidget::getOptions ( )

This method returns the options of the widget as set in the registration.

Implements TYPO3\CMS\Dashboard\Widgets\WidgetInterface.

Definition at line 69 of file CtaWidget.php.

References TYPO3\CMS\Dashboard\Widgets\CtaWidget\$options.

◆ renderWidgetContent()

TYPO3\CMS\Dashboard\Widgets\CtaWidget::renderWidgetContent ( )

This method returns the content of a widget. The returned markup will be delivered by an AJAX call and will not be escaped. Be aware of XSS and ensure that the content is well encoded.

Implements TYPO3\CMS\Dashboard\Widgets\WidgetInterface.

Definition at line 57 of file CtaWidget.php.

◆ setRequest()

TYPO3\CMS\Dashboard\Widgets\CtaWidget::setRequest ( ServerRequestInterface  $request)

Member Data Documentation

◆ $options

readonly array TYPO3\CMS\Dashboard\Widgets\CtaWidget::$options
private

◆ $request

ServerRequestInterface TYPO3\CMS\Dashboard\Widgets\CtaWidget::$request
private

Definition at line 41 of file CtaWidget.php.

Referenced by TYPO3\CMS\Dashboard\Widgets\CtaWidget\setRequest().