WidgetMaker
Widget Maker Trait
trait Backend\Traits\WidgetMaker
Adds widget based methods to a controller class, or a class that
contains a $controller
property referencing a controller.
Methods
public
makeFormWidget (string $class, array $fieldConfig = []
, array $widgetConfig = []
)
: Backend\Classes\FormWidgetBase
Makes a form widget object with the supplied form field and widget configuration.
Parameters
Property | Type | Description |
---|---|---|
$class | string |
string
Widget class name |
$fieldConfig | array |
array
A field name, an array of config or a FormField object. |
$widgetConfig | array |
array
An array of config. |
Returns
The widget object
public
makeWidget (string $class, array $widgetConfig = []
)
: mixed | Backend\Classes\WidgetBase
Makes a widget object with the supplied configuration file.
Parameters
Property | Type | Description |
---|---|---|
$class | string |
string
Widget class name |
$widgetConfig | array |
array
An array of config. |
Returns
mixed | Backend\Classes\WidgetBase
The widget object
Copyright © 2023 Winter CMS