Answer the question
In order to leave comments, you need to log in
How to download arbitrary text in html format displayed on a page?
Text is passed to the page (created in the wysiwyg editor) in the $model->content variable.
With the help of download I want to download the given text to a file.
$this->registerJs(<<<JS
(function() {
$('.btn-download').on('click', function(e) {
e.preventDefault();
download(new Blob(["$model->content"]), "fileName");
});
})();
JS
)
?>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question