Backend\Classes\WidgetManager\HasFormWidgets
Protected Properties
protected array $formWidgets
formWidgets stored in the form of ['FormWidgetClass' => $formWidgetInfo]
protected array $formWidgetCallbacks
formWidgetCallbacks cache
protected array $formWidgetHints
formWidgetHints keyed by their code. Stored in the form of ['formwidgetcode' => 'FormWidgetClass'].
Public Methods
public listFormWidgets()
public listFormWidgets(): array
listFormWidgets returns a list of registered form widgets.
public registerFormWidget()
public registerFormWidget(
string $className,
array $widgetInfo = null
): void
registerFormWidget registers a single form widget.
public registerFormWidgets()
public registerFormWidgets($definitions): void
registerFormWidgets manually registers form widget for consideration. Usage:
WidgetManager::registerFormWidgets(function ($manager) {
$manager->registerFormWidget(\Backend\FormWidgets\CodeEditor::class, 'codeeditor');
});
public resolveFormWidget()
public resolveFormWidget(string $name): string
resolveFormWidget returns a class name from a form widget code Normalizes a class name or converts an code to its class name. Returns the class name resolved, or the original name.