本文整理汇总了PHP中eZXMLTextType::transformLinksToRemoteLinks方法的典型用法代码示例。如果您正苦于以下问题:PHP eZXMLTextType::transformLinksToRemoteLinks方法的具体用法?PHP eZXMLTextType::transformLinksToRemoteLinks怎么用?PHP eZXMLTextType::transformLinksToRemoteLinks使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类eZXMLTextType
的用法示例。
在下文中一共展示了eZXMLTextType::transformLinksToRemoteLinks方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: serializeContentObjectAttribute
function serializeContentObjectAttribute($package, $objectAttribute)
{
$DOMNode = $this->createContentObjectAttributeDOMNode($objectAttribute);
$xmlString = $objectAttribute->attribute('data_text');
if ($xmlString != '') {
$doc = new DOMDocument('1.0', 'utf-8');
$success = $doc->loadXML($xmlString);
/* For all links found in the XML, do the following:
* - add "href" attribute fetching it from ezurl table.
* - remove "id" attribute.
*/
$links = $doc->getElementsByTagName('link');
$embeds = $doc->getElementsByTagName('embed');
$objects = $doc->getElementsByTagName('object');
$embedsInline = $doc->getElementsByTagName('embed-inline');
eZXMLTextType::transformLinksToRemoteLinks($links);
eZXMLTextType::transformLinksToRemoteLinks($embeds);
eZXMLTextType::transformLinksToRemoteLinks($objects);
eZXMLTextType::transformLinksToRemoteLinks($embedsInline);
$importedRootNode = $DOMNode->ownerDocument->importNode($doc->documentElement, true);
$DOMNode->appendChild($importedRootNode);
}
return $DOMNode;
}