本文整理汇总了PHP中Zend_View::layout方法的典型用法代码示例。如果您正苦于以下问题:PHP Zend_View::layout方法的具体用法?PHP Zend_View::layout怎么用?PHP Zend_View::layout使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Zend_View
的用法示例。
在下文中一共展示了Zend_View::layout方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: downloadExportFile
/**
* Performs actual download
*
* @param \MUtil_Model_Bridge_FormBridgeInterface $bridge
* @param \MUtil_Model_ModelAbstract $model
*/
protected function downloadExportFile()
{
$this->view->layout()->disableLayout();
\Zend_Controller_Action_HelperBroker::getExistingHelper('viewRenderer')->setNoRender(true);
$batch = $this->getExportBatch(false);
$downloadName = $batch->getSessionVariable('downloadname');
$localFilename = $batch->getSessionVariable('filename');
header("Content-Type: application/download");
header("Content-Disposition: attachment; filename=\"{$downloadName}\"");
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");
// Date in the past
header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
header("Cache-Control: must-revalidate, post-check=0, pre-check=0");
header("Pragma: cache");
// HTTP/1.0
readfile($localFilename);
exit;
}
示例2: elseif
Zend_Db_Table::setDefaultAdapter($db);
$db->query('SET NAMES ' . $config->charset);
Zend_Registry::set('db', $db);
// Remove the following line in production
$frontController->throwExceptions(true);
$frontController->setBaseUrl('/mailer/');
$frontController->addModuleDirectory('application/modules');
$view = new Zend_View();
$view->doctype('XHTML1_STRICT');
$view->setEncoding('UTF-8');
$view->baseUrl = $frontController->getBaseUrl();
// layout to be determined by the AjaxCheckPlugin, see library directory for details :)
$viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view);
Zend_Controller_Action_HelperBroker::addHelper($viewRenderer);
// Paginator setup
Zend_Paginator::setDefaultScrollingStyle('Sliding');
Zend_View_Helper_PaginationControl::setDefaultViewPartial('paginator.phtml');
// Run the dispatcher
$frontController->returnResponse(true);
$response = $frontController->dispatch();
// Output in UTF-8
if ($view->layout()->isEnabled()) {
if ($view->layout()->getLayout() == 'common') {
$response->setHeader("Content-Type", "text/html; charset=UTF-8", true);
} elseif ($view->layout()->getLayout() == 'ajax') {
$response->setHeader("Content-Type", "text/xml; charset=UTF-8", true);
} elseif ($view->layout()->getLayout() == 'xml') {
$response->setHeader("Content-Type", "text/xml; charset=UTF-8", true);
}
}
$response->sendresponse();
示例3: render
/**
* Renders the entire report (including layout)
*
* @param array|string[] $respondentId
* @param boolean $group Group same surveys or not
* @param string $format html|pdf, the output format to use
*/
public function render($respondents, $group = true, $format = 'html')
{
$this->_group = $group;
$this->html->snippet($this->_reportHeader);
$respondentCount = count($respondents);
$respondentIdx = 0;
foreach ($respondents as $respondentId) {
$respondentIdx++;
$this->_exportRespondent($respondentId);
if ($respondentIdx < $respondentCount) {
// Add some whitespace between patients
$this->html->div('', array('style' => 'height: 100px'));
}
}
$this->html->snippet($this->_reportFooter, 'respondents', $respondents);
$this->menu->setVisible(false);
if ($this->escort instanceof \Gems_Project_Layout_MultiLayoutInterface) {
$this->escort->layoutSwitch();
}
$this->escort->postDispatch(\Zend_Controller_Front::getInstance()->getRequest());
\Zend_Controller_Action_HelperBroker::getExistingHelper('layout')->disableLayout();
\Zend_Controller_Action_HelperBroker::getExistingHelper('viewRenderer')->setNoRender(true);
$this->view->layout()->content = $this->html->render($this->view);
$content = $this->view->layout->render();
if ($format == 'pdf') {
if (is_array($respondentId) && isset($respondentId['gr2o_id_organization'])) {
$respondentId = $respondentId['gr2o_patient_nr'];
}
$filename = 'respondent-export-' . strtolower($respondentId) . '.pdf';
$content = $this->_pdf->convertFromHtml($content);
$this->_pdf->echoPdfContent($content, $filename, true);
} else {
echo $content;
}
$this->menu->setVisible(true);
}