本文整理匯總了PHP中HTML_Page2::setMetaContentType方法的典型用法代碼示例。如果您正苦於以下問題:PHP HTML_Page2::setMetaContentType方法的具體用法?PHP HTML_Page2::setMetaContentType怎麽用?PHP HTML_Page2::setMetaContentType使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類HTML_Page2
的用法示例。
在下文中一共展示了HTML_Page2::setMetaContentType方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1:
// The initializing code can also be in in the form of an HTML
// attr="value" string.
// Possible attributes are:
// - cache ("true" or "false")
// - charset (e.g., "utf-8")
// - doctype (e.g., "XHTML Basic 1.0")
// - language (two letter designator: e.g., "en")
// - lineend ("unix", "win", "mac", custom string)
// - mime (e.g., "application/xhtml+xml")
// - namespace (URI)
// - profile (URI)
// - tab (e.g., " ")
// - disableProlog (bool)
// All the above have defaults, so it is not necessary
// to specify everything. For example, the proper namespace
// is chosen by default.
$page = new HTML_Page2(['lineend' => 'unix', 'doctype' => 'XHTML 1.0 Strict', 'language' => 'en', 'cache' => 'false', 'tab' => ' ']);
// Page title defaults to "New $doctypeString Compliant Page"
$page->setTitle("HTML_Page2 Color Chart example");
$page->setMetaData("author", "Klaus Guenther");
// let's add a Content-Type meta tag
$page->setMetaContentType();
// Objects with toHtml and toString are supported.
$page->addBodyContent($table);
$page->addBodyContent('<p>Copyright 2003 The PHP Group</p>');
// oops, forgot to add the header:
$page->addBodyContent("<h1>Color Chart</h1>", HTML_PAGE2_PREPEND);
// output to browser
$page->display();
// or to a file
//$page->toFile('example.html');