本文整理汇总了PHP中EB::document方法的典型用法代码示例。如果您正苦于以下问题:PHP EB::document方法的具体用法?PHP EB::document怎么用?PHP EB::document使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EB
的用法示例。
在下文中一共展示了EB::document方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: renderEditorContent
/**
* Used during post editing so we can render the necessary blocks
*
* @since 5.0
* @access public
* @param string
* @return
*/
public function renderEditorContent()
{
if ($this->doctype == 'ebd') {
// If this is a empty document,
// start with a text block.
if (empty($this->document)) {
$blocks = EB::blocks();
$block = $blocks->createBlock("text");
$content = $blocks->renderEditableBlock($block);
// If this is an existing document,
// get editable content.
} else {
$document = EB::document($this->document);
$content = $document->getEditableContent();
}
} else {
// Format the post content now
$content = $this->intro;
// Append the readmore if necessary
if (!empty($this->intro) && !empty($this->content)) {
$content .= '<hr id="system-readmore" />';
}
// Append the rest of the contents
$content .= $this->content;
}
return $content;
}
示例2: getDocument
/**
* Retrieves the document object for this revision
*
* @since 5.0
* @access public
* @param string
* @return
*/
public function getDocument()
{
static $documents = array();
if (!isset($documents[$this->id])) {
$content = $this->getContent();
$document = EB::document($content->document);
$documents[$this->id] = $document;
}
return $documents[$this->id];
}
示例3: getDocument
/**
* Retrieves the document object
*
* @since 5.0
* @access public
* @param string
* @return
*/
public function getDocument()
{
static $documents = array();
if (!isset($documents[$this->id])) {
$document = EB::document();
$document->load($this->data);
$documents[$this->id] = $document;
}
return $documents[$this->id];
}