fix #314, 实现header/footer的html输出

This commit is contained in:
wlx 2012-03-23 06:42:11 +00:00
parent 123701ef2a
commit 58374261f4
1 changed files with 26 additions and 1 deletions

View File

@ -1260,5 +1260,30 @@ class ServiceController extends Zend_Controller_Action
include_once('ImgCode.php');
$imagecode=new Custom_Controller_Plugin_ImgCode();
$imagecode->image2();
}
}
//header output
function headerAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$header=file_get_contents('../application/default/views/scripts/header.phtml');
$content='<link rel="stylesheet" type="text/css" media="screen"
href="/css/default.css" />';
$content.=eval('?>'.$header);
$content.='<script src="/js/navi.js" type="text/javascript"></script>';
$this->getResponse()->setHeader('Content-Type', 'text/html')
->setBody($content);
}
//footer output
function footerAction()
{
$this->_helper->layout->disableLayout();
$this->_helper->viewRenderer->setNoRender();
$footer=file_get_contents('../application/default/views/scripts/footer.phtml');
$this->getResponse()->setHeader('Content-Type', 'text/html')
->setBody($footer);
}
}