On the current page I already have button, which enrols me in a course, now I want to add such button to download the summary of the course in pdf. The current button looks like this:
.= html_writer::div(html_writer::tag("button", get_string('enrol', 'local_customenrol'), array('class' => 'ebutton')), 'enrol');
I added the Download in PDF button like this:
.= html_writer::div(html_writer::tag("button", get_string('printpdf', 'local_customenrol'), array('class' => 'printpdf')), 'printpdf');
The enrol button works with javascript in local_customenrol.js, the printing of the page summary is made in printpdf.php, I just can not make it to trigger the download. I preffer to make it in php, if possible, or should I use javascript?