本文整理匯總了PHP中WebPage::output方法的典型用法代碼示例。如果您正苦於以下問題:PHP WebPage::output方法的具體用法?PHP WebPage::output怎麽用?PHP WebPage::output使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類WebPage
的用法示例。
在下文中一共展示了WebPage::output方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: ReportErrorAndExit
function ReportErrorAndExit($sErrorMessage)
{
if (utils::IsModeCLI()) {
$oP = new CLIPage("iTop - Export");
$oP->p('ERROR: ' . $sErrorMessage);
$oP->output();
exit - 1;
} else {
$oP = new WebPage("iTop - Export");
$oP->p('ERROR: ' . $sErrorMessage);
$oP->output();
exit - 1;
}
}
示例2: output
/**
* Outputs (via some echo) the complete HTML page by assembling all its elements
*/
public function output()
{
//$this->set_base($this->m_sRootUrl.'pages/');
if (count($this->m_aReadyScripts) > 0) {
$this->add_script("\$(document).ready(function() {\n" . implode("\n", $this->m_aReadyScripts) . "\n});");
}
parent::output();
}
示例3: ReadMandatoryParam
require_once APPROOT . '/application/startup.inc.php';
function ReadMandatoryParam($oP, $sParam, $sSanitizationFilter = 'parameter')
{
$sValue = utils::ReadParam($sParam, null, true, $sSanitizationFilter);
if (is_null($sValue)) {
$oP->p("ERROR: Missing argument '{$sParam}'\n");
exit(29);
}
return trim($sValue);
}
/////////////////////////////////
// Main program
if (!utils::IsModeCLI()) {
$oP = new WebPage(Dict::S("TitleSynchroExecution"));
$oP->p("This page is used internally by iTop");
$oP->output();
exit - 2;
}
$oP = new CLIPage(Dict::S("TitleSynchroExecution"));
try {
utils::UseParamFile();
} catch (Exception $e) {
$oP->p("Error: " . $e->GetMessage());
$oP->output();
exit - 2;
}
// Next steps:
// specific arguments: 'csvfile'
//
$sAuthUser = ReadMandatoryParam($oP, 'auth_user', 'raw_data');
$sAuthPwd = ReadMandatoryParam($oP, 'auth_pwd', 'raw_data');