CodeIgniter Forums
Open pdf document - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Using CodeIgniter (https://forum.codeigniter.com/forumdisplay.php?fid=5)
+--- Forum: General Help (https://forum.codeigniter.com/forumdisplay.php?fid=24)
+--- Thread: Open pdf document (/showthread.php?tid=67343)



Open pdf document - msheath - 02-12-2017

Normally I open a pdf document directly from a link but suppose I want to add conditionality so that eg the pdf would open before 12.00 but not after 12.00. In that case I would like the link to go to a controller function where I could add the conditionality and then, if the condition is met, open the pdf. If I want to load a view I would use the load->view syntax but how would I load a pdf which is not in the view folder?

something like:

PHP Code:
function pdf_launch() {
 
$this->load->view('public/pdf/test.pdf');
 } 

but that of course won't work.


RE: Open pdf document - ignitedcms - 02-12-2017

Set a condition using php's date function. This would all depend on what time locale your site is set to.