Skip to content

Latest commit

 

History

History
14 lines (10 loc) · 466 Bytes

field_factory.md

File metadata and controls

14 lines (10 loc) · 466 Bytes

field_factory

field_factory(name, definition = null) is a Twig function to create a field on the fly with a name and optional definition.

Parameter Description
name The name of the field
definition The definition of the field, same options as a field definition in contenttypes.yaml
{% set field = field_factory('title', { 'type': 'text', 'label' : 'Awesome title' }) %}

Source: Forms