Skip to content

Exporting a submission as a PDF #1273

Answered by engram-design
stuh asked this question in Q&A
Discussion options

You must be logged in to vote

My other suggestion would be to create a custom exporter class (if you've got some module / PHP know-how), which when registered, you could add your own logic for how an export is run.

use verbb\formie\elements\Submission;
use craft\events\RegisterElementExportersEvent;
use yii\base\Event;

Event::on(
    Submission::class,
    Submission::EVENT_REGISTER_EXPORTERS,
    function(RegisterElementExportersEvent $event) {
        $event->exporters[] = MyElementExporter::class;
    }
);

More info https://craftcms.com/docs/3.x/extend/element-exporter-types.html

Replies: 2 comments 4 replies

Comment options

You must be logged in to vote
4 replies
@stuh
Comment options

@jubalj
Comment options

@stuh
Comment options

@jubalj
Comment options

Answer selected by stuh
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants