BaseWidget
Namespace
Ceres\Widgets\Helper
Implements
Type | Name | Value | Description |
---|---|---|---|
|
['','bold,italic,underline,strike |
h1,h2,h3 |
|
align |
translation','bold,italic,underline,strike |
headline |
link |
align,ul,ol |
color,background |
translation'] |
Type | Name | Description |
---|---|---|
|
A map for types to corresponding templates |
|
|
The template to be used for this widget |
|
|
||
|
||
|
Methods
public __construct($twig, $app)
BaseWidget constructor.
Type |
Name |
Description |
|
Class to render twig templates. |
|
|
Helper class to retrieve information from the application. |
public getData():array
Get basic information about the widget. Possible fields are - identifier - label - previewImageURL - type - categories - position
public getSettings():array
Return the structure of the settings for the widget
public getPreview($widgetSettings = [], $children = []):string
Get the html representation of the widget.
Type |
Name |
Description |
|
The settings provided by the widget. |
|
|
The child widgets of the widget. |
public render($widgetSettings = [], $children = []):string
Render the template of the widget.
Type |
Name |
Description |
|
The settings provided by the widget. |
|
|
The child widgets of the widget. |
public getTemplateData($widgetSettings, $isPreview):array
Get additional data to be passed to the template while rendering.
Type |
Name |
Description |
|
The settings provided by the widget. |
|
|
A flag provided to determine if the widget is currently shown in preview. |
public getPreviewData($widgetSettings):array
Get additional data to be passed to the template while rendering the preview markup.
Type |
Name |
Description |
|
The settings provided by the widget. |
public mockPaginatedResult($factory, $itemsPerPage = 10, $currentPage = 1, $pages = 5):array
Mock a paginated result
Type |
Name |
Description |
|
The widget factory which should be mocked. |
|
|
The number of items which should be mocked. |
|
|
The current page of the result. |
|
|
The total count of pages. |