本文整理汇总了PHP中ContentElement::getTableName方法的典型用法代码示例。如果您正苦于以下问题:PHP ContentElement::getTableName方法的具体用法?PHP ContentElement::getTableName怎么用?PHP ContentElement::getTableName使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentElement
的用法示例。
在下文中一共展示了ContentElement::getTableName方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Loading of specific XML files
*/
function _loadContentElement($tablename)
{
if (!is_array($this->_contentElements)) {
$this->_contentElements = array();
}
if (array_key_exists($tablename, $this->_contentElements)) {
return;
}
$file = FALANG_ADMINPATH . '/contentelements/' . $tablename . ".xml";
if (file_exists($file)) {
unset($xmlDoc);
$xmlDoc = new DOMDocument();
if ($xmlDoc->load($file)) {
$element = $xmlDoc->documentElement;
if ($element->nodeName == 'falang') {
if ($element->getAttribute('type') == 'contentelement') {
$nameElements = $element->getElementsByTagName('name');
$nameElement = $nameElements->item(0);
$name = strtolower(trim($nameElement->textContent));
$contentElement = new ContentElement($xmlDoc);
$this->_contentElements[$contentElement->getTableName()] = $contentElement;
return $contentElement;
}
}
}
}
return null;
}
示例2: _loadContentElement
/**
* Loading of specific XML files
*/
private function _loadContentElement($tablename)
{
if (array_key_exists($tablename, $this->_contentElements)) {
return;
}
self::addIncludePath(JOOMFISH_LIBPATH . DS . 'contentelement' . DS . 'contentelements', 'contentelements');
self::addIncludePath(JOOMFISH_ADMINPATH . DS . 'contentelements', 'contentelements');
$contentelementlocations = self::addIncludePath('', 'contentelements');
foreach ($contentelementlocations as $location) {
$file = $location . DS . $tablename . ".xml";
if (file_exists($file)) {
unset($xmlDoc);
$xmlDoc = new DOMDocument();
if ($xmlDoc->load($file)) {
$element = $xmlDoc->documentElement;
if ($element->nodeName == 'joomfish') {
if ($element->getAttribute('type') == 'contentelement') {
$nameElements = $element->getElementsByTagName('name');
$nameElement = $nameElements->item(0);
$name = strtolower(trim($nameElement->textContent));
$contentElement = new ContentElement($xmlDoc);
$this->_contentElements[$contentElement->getTableName()] = $contentElement;
return $contentElement;
}
}
}
break;
}
}
return null;
}