Documentation

WidgetMaker

Widget Maker Trait

Adds widget based methods to a controller class, or a class that contains a $controller property referencing a controller.

Tags
author

Alexey Bobkov, Samuel Georges

Table of Contents

makeFormWidget()  : FormWidgetBase
Makes a form widget object with the supplied form field and widget configuration.
makeWidget()  : mixed|WidgetBase
Makes a widget object with the supplied configuration file.

Methods

makeFormWidget()

Makes a form widget object with the supplied form field and widget configuration.

public makeFormWidget(string $class[, mixed $fieldConfig = [] ][, array<string|int, mixed> $widgetConfig = [] ]) : FormWidgetBase
Parameters
$class : string

Widget class name

$fieldConfig : mixed = []

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

$widgetConfig : array<string|int, mixed> = []

An array of config.

Return values
FormWidgetBase

The widget object

makeWidget()

Makes a widget object with the supplied configuration file.

public makeWidget(string $class[, array<string|int, mixed> $widgetConfig = [] ]) : mixed|WidgetBase
Parameters
$class : string

Widget class name

$widgetConfig : array<string|int, mixed> = []

An array of config.

Return values
mixed|WidgetBase

The widget object

Search results