本文整理汇总了PHP中Feed::cdata方法的典型用法代码示例。如果您正苦于以下问题:PHP Feed::cdata方法的具体用法?PHP Feed::cdata怎么用?PHP Feed::cdata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Feed
的用法示例。
在下文中一共展示了Feed::cdata方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __toString
public function __toString()
{
$out = "\t\t<item>\n";
$out .= Feed::renderTag('title', Feed::cdata($this->title), 3);
$out .= Feed::renderTag('link', $this->link, 3);
$out .= Feed::renderTag('description', Feed::cdata($this->description), 3);
$out .= Feed::renderTag('guid', $this->guid, 3);
$out .= Feed::renderTag('pubDate', Feed::convertTime($this->pubDate), 3);
$out .= Feed::renderTag('author', $this->author[0] . ' (' . $this->author[1] . ')', 2);
return $out . "\t\t</item>\n";
}
示例2: fetch
public function fetch()
{
$this->validateChannel();
$out = '<?xml version="1.0"?>' . "\n";
$out .= '<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">' . "\n";
$out .= "\t<channel>\n";
$out .= Feed::renderTag('title', Feed::cdata($this->title), 2);
$out .= Feed::renderTag('link', $this->link, 2);
if (!empty($this->selfLink)) {
$out .= "\t\t" . '<atom:link href="' . $this->selfLink . '" rel="self" type="application/rss+xml" />' . "\n";
}
$out .= Feed::renderTag('description', $this->description, 2);
$out .= Feed::renderTag('language', $this->language, 2);
$out .= Feed::renderTag('pubDate', Feed::convertTime($this->pubDate), 2);
$out .= Feed::renderTag('lastBuildDate', Feed::convertTime($this->lastBuildDate), 2);
$out .= Feed::renderTag('docs', $this->docs, 2);
$out .= Feed::renderTag('generator', $this->generator, 2);
$out .= Feed::renderTag('managingEditor', $this->managingEditor[0] . ' (' . $this->managingEditor[1] . ')', 2);
$out .= Feed::renderTag('webMaster', $this->webMaster[0] . ' (' . $this->webMaster[1] . ')', 2);
foreach ($this->items as $item) {
$out .= $item;
}
$out .= "\t</channel>\n";
$out .= '</rss>';
return $out;
}