Modification des références vers les css, images et scripts javascript dans le html enregistré pour le PDF

This commit is contained in:
Michael RICOIS 2011-05-19 12:20:34 +00:00
parent 27918af266
commit 4d98b294f2

View File

@ -10,7 +10,9 @@ class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
if ($page->exportable('pdf')){
$layout = $this->_response->getBody();
$filename = $page->filename('pdf', $this->_request->getParams());
file_put_contents(APPLICATION_PATH.'/../cache/pages/'.$filename.'.html', $layout);
$content = preg_replace('@<link href="/@si','<link href="./',$layout);
$content = preg_replace('@src="/@si','src="./',$content);
file_put_contents(APPLICATION_PATH.'/../cache/pages/'.$filename.'.html', $content);
}
}
}