本文整理匯總了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;
}