In case you want to write your own list field column rendered you need to implement
LIN3S\AdminBundle\ListFields\ListFieldType
. The render()
method is expected to return an already escaped
string, can be HTML but be careful as it will be printed in the list without been escaped.
ListFieldTypes are usually generic and need to be associated with an entity in the configuration.
- Create a new class implementing
LIN3S\AdminBundle\ListFields\ListFieldType
- Add the class to Dependency Container with
lin3s_admin.list_field_type
tag name and the desired alias. - Reference the created service with the alias in the property
type
of list > field > field_name of youradmin.yml
You can handle the header representation of the column within this function, these are the parameters available:
- options: Array with the name of the field.
- configuration: The configuration.
You can handle the header representation of the row within this function, these are the parameters available:
- entity: The entity to represent in the row.
- options: Array with the options declared in admin.yml
- configuration: The configuration.
Translating header or rendered row content is possible adding the argument "@translator.default"
to receive an
instance of translator ready to use.