What is the «frontend_model» for a backend configuration form field?

The frontend_model optional tag defines a renderer class for the config field.


As you can see from the code above, the frontend_model tag is optional for a config field. If the frontend_model is not defined then Magento 2 uses the standard frontend model: \Magento\Config\Block\System\Config\Form\Field:

For the backend the default frontend model is \Magento\Backend\Block\Widget\Form\Renderer\Fieldset\Element: The default backend config form element renderer.

A frontend model class should be a subclass of \Magento\Framework\View\Element\AbstractBlock:

See How does \Magento\Framework\View\Layout::getBlockSingleton() work?

A frontend model class should also implement the \Magento\Framework\Data\Form\Element\Renderer\RendererInterface:

See also:

https://github.com/magento/magento2/issues/2390

See also: