سؤال

I want to add an action that will output xml file from object's fields.

Here is an example:

object_actions:
  _edit: ~
  _delete: ~
  export_xliff: {label : Export Xliff, action: exportXliff}

This creates a button/link to ../exportXliff, but I want the ../exportXliff.xml.

How do I add the format from admin generator config file ?

هل كانت مفيدة؟

المحلول

I don't think you can add a format here and according to the code, it's seems to be only html ..

Do you need to have different format as output or only xml?

If your are using only xml, you can change the format from the action.

$request->setRequestFormat('xml');

First I was thinking of using a defined route in the routing.yml, but it seems you can't.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top