-
-
Notifications
You must be signed in to change notification settings - Fork 547
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[4.x] Allow custom form exporters to be defined #8837
[4.x] Allow custom form exporters to be defined #8837
Conversation
This is huge! It would be nice if there was an option to limit exports to specific forms. |
@marcorieser sure, easily added. You specify a |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great idea. Just have a little different direction in mind.
All changes made as requested. I also made it possible in the CSV exporter to define |
- Add types - Remove docblocks - Remove exporter interface in favor of forcing the abstract class, and rename it. - Remove exporter form method, just use the property. - Separate getter/setter methods. - Form can get its own exporters - Clean up blade by calling exporter methods - Clean up controller by moving logic into exporter class and repo - Just 404 on invalid types rather than exceptions - You can override the exporter title in the config - Exporter has title method that translates
This PR allows custom form exporters to be defined in a new
statamic.forms.exporters
config key.Say for example you wanted to add your own Excel exporter:
I've modified both the exporter contract and abstract class to allow config values to be set.
You can also specify a
forms
key in the config, and it will limit the exporter to those form handles.Closes statamic/ideas#834