Contents

Backend\Classes\FormDesignBase

Overview

FormDesignBase is a base class for form design behaviors that control how backend forms are displayed. Each form design is a controller behavior applied via extendClassWith() that provides rendering, assets, and AJAX handlers for a specific form layout.

Extends

Public Properties

There are no public properties in the class.

Show inherited public properties

Inherited Public Properties

Protected Properties

protected array $actions

actions visible in context of the controller

Show inherited protected properties

Inherited Protected Properties


Public Methods

public extendFormWidgetConfig()

public extendFormWidgetConfig($config): void 

extendFormWidgetConfig allows the design to modify the form widget configuration before the widget is created, e.g. to enable horizontal mode or survey mode.

public formRenderDesignButtons()

public formRenderDesignButtons(): string 

formRenderDesignButtons renders the buttons for this design

public formRenderDesignError()

public formRenderDesignError($fatalError): string 

formRenderDesignError renders the error state for this design

public getDesignBodyClass()

public getDesignBodyClass(): string|null 

getDesignBodyClass returns a CSS class for the page body

public getDesignFormSize()

public getDesignFormSize($name = 'size'): void

getDesignFormSize returns the page size taken from the form configuration, can also specify a custom configuration name, e.g. sidebarSize

public getDesignSecondaryLabel()

public getDesignSecondaryLabel(): string 

getDesignSecondaryLabel returns the label for the secondary fields popover

public init()

public init(): void 

init is called after the design behavior is applied to the controller. Override to register assets, Vue components, or perform other setup.

public renderDesignContent()

public renderDesignContent($options = []): string 

renderDesignContent renders the form design layout content. The controller can override the design partial by providing a _form_mode_{code}.php partial in its views directory, e.g. _form_mode_document.php.

Show inherited public methods

Inherited Public Methods

Protected Methods

protected getDesignConfig()

protected getDesignConfig($name, $default = null): void

getDesignConfig reads a design config value from the FormController YAML config, checking the context-specific value first, then falling back to the global value

protected getFormController()

protected getFormController(): Backend\Behaviors\FormController 

getFormController returns the FormController behavior instance

Show inherited protected methods

Inherited Protected Methods