Modifying generator.yml views in Symfony
- by Alex Ciminian
Hey!
I'm currently working on a web app written in Symfony. I'm supposed to add an "export to CSV" feature in the backend/administration part of the app for some modules. In the list view, there should be an "Export" button which should provide the user with a csv file of the elements that are displayed (considering filtering criteria).
I've created a method in the actions class of the module that takes a comma separated list of ids and generates the CSV, but I'm not really sure how to add the link to it in the view. The problem is that the view doesn't exist anywhere, it's generated on the fly from the data in the generator.yml configuration file. I've posted the relevant part of the file below.
list:
display: [=name, indemn, _status, _participants, _approved_, created_at]
title: Lista actiuni
object_actions:
_edit: ~
_delete: ~
filters: [name, county_id, _status_filter, activity_id]
fields:
name:
name: Nume Actiune
indemn:
name: Îndemn la actiune
description:
name: Descriere
approved_:
name: Operatiune
created_at:
name: Creata la
status:
name: Status Actiune
I'm new to Symfony, so any help would be appreciated :).
Thanks,
Alex