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 Description
$class
string

Widget class name

$fieldConfig
array

A field name, an array of config or a FormField object.

$widgetConfig
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 Description
$class
string

Widget class name

$widgetConfig
array

An array of config.

Returns

The widget object

Copyright © 2024 Winter CMS