Tags:
// components/com_foo/view/report/file.php class ComFooViewReport extends KViewFileNow you can download the file using ?option=com_foo&view=report
{
public function display()
{
// Filename that is sent to browser
$this->assign('filename', 'My Report.pdf');
// Actual filename on the filesystem
$this->assign('path', '/path/to/My Report.pdf');
// OPTIONAL. If omitted, Nooku will figure this out by itself
$this->assign('mimetype', 'application/pdf');
// OPTIONAL: 'inline' to force to browser, 'attachment' to force download
// Defaults to 'attachment'
$this->assign('disposition', 'inline');
return parent::display();
}
}
© 2012 Created by Amy Stephen.