18 lines
691 B
PHP
18 lines
691 B
PHP
<?php
|
|
class Application_Controller_Plugin_Pdf extends Zend_Controller_Plugin_Abstract
|
|
{
|
|
public function dispatchLoopShutdown()
|
|
{
|
|
require_once 'Scores/PagePrint.php';
|
|
$controller = $this->_request->getControllerName();
|
|
$action = $this->_request->getActionName();
|
|
$page = new PagePrint($controller, $action);
|
|
if ($page->exportable('pdf')){
|
|
$layout = $this->_response->getBody();
|
|
$filename = $page->filename('pdf', $this->_request->getParams());
|
|
$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);
|
|
}
|
|
}
|
|
} |