本文整理汇总了PHP中CopixTpl::display方法的典型用法代码示例。如果您正苦于以下问题:PHP CopixTpl::display方法的具体用法?PHP CopixTpl::display怎么用?PHP CopixTpl::display使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CopixTpl
的用法示例。
在下文中一共展示了CopixTpl::display方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switch
/**
* Agit selon le résultat de l'execution de l'action de la méthode de l'objet ActionGroup
* Methode qui va effectuer un affichage de template, une redirection etc... en fonction
* du code indiqué par le CopixActionReturn.
* @param CopixActionReturn $ToProcess indique le type de resultat
* @see CopixActionGroup
* @todo rajouter une sorte de "Fin de traitement" _DoEnd / _DoFirst
* @access private
*/
function _processResult($toProcess)
{
switch ($toProcess->code) {
case COPIX_AR_ERROR:
//erreur
$tpl = new CopixTpl();
$tpl->assign('message', $toProcess->data);
$tpl->display($this->moduleDir . COPIX_TEMPLATE_PATH . 'error.tpl');
break;
case COPIX_AR_DISPLAY:
//affichage classique, dans le template principal.
$this->_processStandard($toProcess->data);
//appel de la méthode de préparation de la page standard.
$this->_doHTMLHeaders($toProcess->data);
//Par ex, bandeaux de pub, menus dynamiques, ... (propres aux projets.)
CopixContext::clear();
$toProcess->data->display($GLOBALS['COPIX']['CONFIG']->mainTemplate);
break;
case COPIX_AR_DISPLAY_IN:
//affichage spécifique, dans un template indiqué.
$this->_processStandard($toProcess->data);
//appel de la méthode de préparation de la page standard.
$this->_doHTMLHeaders($toProcess->data);
//Par ex, bandeaux de pub, menus dynamiques, ... (propres aux projets.)
$toProcess->data->display($toProcess->more);
break;
case COPIX_AR_REDIRECT:
//redirection standard, message http.
header('location: ' . $toProcess->data);
break;
case COPIX_AR_STATIC:
$tpl =& new CopixTpl();
$tpl->assign('MAIN', $this->includeStatic($toProcess->data));
$this->_processStandard($tpl);
$this->_doHTMLHeaders($tpl);
$waitForMore = array('TITLE_PAGE', 'TITLE_BAR');
foreach ($waitForMore as $key) {
if (isset($toProcess->more[$key])) {
$tpl->assign($key, $toProcess->more[$key]);
}
}
//Affichage dans le template principal.
CopixContext::clear();
$tpl->display($GLOBALS['COPIX']['CONFIG']->mainTemplate);
break;
case COPIX_AR_DOWNLOAD:
$fileName = $toProcess->data;
if (is_readable($fileName) && is_file($fileName)) {
//quick and dirty..... still.
if (strlen(trim($toProcess->more))) {
$fileNameOnly = $toProcess->more;
} else {
$fileNameOnly = explode('/', str_replace('\\', '/', $fileName));
$fileNameOnly = $fileNameOnly[count($fileNameOnly) - 1];
}
header("Content-Type: application/forcedownload");
header("Content-Disposition: attachment; filename=" . $fileNameOnly);
header("Content-Description: File Transfert");
header("Content-Transfer-Encoding: binary");
header("Pragma: no-cache");
header("Cache-Control: no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
header("Expires: 0");
header("Content-Length: " . filesize($fileName));
flush();
readfile($fileName);
}
break;
case COPIX_AR_BINARY:
$fileName = $toProcess->data;
//echo $fileName;
if (is_readable($fileName) && is_file($fileName)) {
header("Content-Type: " . $toProcess->more);
header("Content-Length: " . filesize($fileName));
flush();
readfile($fileName);
}
break;
case COPIX_AR_NONE:
break;
default:
break;
}
//appel les plugins de post-processing.
$this->_callPluginsMethodWithParam('afterProcess', $toProcess);
}