本文整理汇总了PHP中XML::text方法的典型用法代码示例。如果您正苦于以下问题:PHP XML::text方法的具体用法?PHP XML::text怎么用?PHP XML::text使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XML
的用法示例。
在下文中一共展示了XML::text方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _getOutput
private function _getOutput()
{
// Make $template and $title accessible in the descendant views
$this->__set('template', $this);
$this->__set('title', $this->title);
// Template View (must run first since ancestor views might call functions from $template)
$templateView = XML::text($this->_template->__toString());
// <html>
$this->_html = XML::element('html');
$this->_html->dir = $this->dir;
if (Kennel::getSetting('i18n', 'enabled')) {
$this->_html->lang = i18n::getLang();
}
// <head>
$this->_head = XML::element('head', $this->_html);
// <title>
$title = XML::element('title', $this->_head);
$title->setValue($this->getTitle());
// favicon
if ($this->favicon) {
$this->_head->adopt(html::favicon($this->favicon));
}
// Content Type
$this->_head->adopt(html::meta(array('charset' => 'utf-8')));
// <meta>
foreach ($this->_meta as $meta) {
$this->_head->adopt(html::meta($meta));
}
// <link>
foreach ($this->_links as $link) {
$this->_head->adopt(html::link($link['rel'], $link['href'], $link['type'], $link['title']));
}
// <style>
$this->_head->adopt(html::css($this->_stylesheets));
// <script>
$this->_head->adopt(html::js($this->_scripts));
// <body>
$this->_body = XML::element('body', $this->_html);
$this->_body->class = browser::css();
if (Kennel::getSetting('i18n', 'enabled')) {
$this->_body->class .= ' ' . i18n::getLang();
}
if ($this->bodyClass) {
$this->_body->class .= ' ' . $this->bodyClass;
}
// Inject the Template View
$this->_body->adopt($templateView);
// Return the whole shebang
return self::$DOCTYPE_DECLARATIONS[$this->doctype] . $this->_html->output(true);
}
示例2: setValue
/**
* Same as XMLElement::setText, but accepts XMLText nodes as well as
* strings
*
* @param XMLText|string $text
*
* @return XMLElement returns the element itself
*/
function setValue($text)
{
if ($text instanceof XMLText) {
$this->adopt($text);
} else {
XML::text($text, $this);
}
return $this;
}