Skip to content

Data lists: Text field#

Example#

$builder
    ->addField('description', TextFieldType::class, [
        'truncate' => 100,
    ])
    ->getDatalist();

Options#

Option Default Description
truncate not set Truncates the value to the given number of characters, using the safe_truncate Twig filter.

This field type also supports the common field options, including escape which is honored by this field type.

Block name#

The block rendered for this field type is text_field. Override it in your own Datalist theme if you need to customize the markup.

Go back to Data lists documentation