本文整理汇总了PHP中XMLParser::setContentOnly方法的典型用法代码示例。如果您正苦于以下问题:PHP XMLParser::setContentOnly方法的具体用法?PHP XMLParser::setContentOnly怎么用?PHP XMLParser::setContentOnly使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XMLParser
的用法示例。
在下文中一共展示了XMLParser::setContentOnly方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: loadTemplate
public function loadTemplate()
{
PHPWS_Core::initCoreClass('XMLParser.php');
$xml = new XMLParser($this->file);
$xml->setContentOnly(true);
if (PHPWS_Error::isError($xml->error)) {
return $xml->error;
}
$result = $xml->format();
if (empty($result['TEMPLATE'])) {
return;
}
$this->data = $result['TEMPLATE'];
if (!isset($this->data['TITLE'])) {
$this->error[] = PHPWS_Error::get(PS_TPL_NO_TITLE, 'pagesmith', 'PS_Template::loadTemplate', $this->name);
return;
}
$this->title =& $this->data['TITLE'];
if (isset($this->data['SUMMARY'])) {
$this->summary =& $this->data['SUMMARY'];
}
if (empty($this->data['THUMBNAIL'])) {
$this->error[] = PHPWS_Error::get(PS_TPL_NO_TN, 'pagesmith', 'PS_Template::loadTemplate', $this->name);
return;
}
$this->thumbnail =& $this->data['THUMBNAIL'];
if (isset($this->data['STYLE'])) {
$this->style =& $this->data['STYLE'];
}
if (empty($this->data['STRUCTURE']['SECTION'])) {
$this->error[] = PHPWS_Error::get(PS_TPL_NO_SECTIONS, 'pagesmith', 'PS_Template::loadTemplate', $this->name);
return;
}
$this->structure =& $this->data['STRUCTURE']['SECTION'];
if (isset($this->data['FOLDERS'])) {
if (is_array($this->data['FOLDERS']['NAME'])) {
$this->folders =& $this->data['FOLDERS']['NAME'];
} else {
$this->folders = array($this->data['FOLDERS']['NAME']);
}
}
}