本文整理汇总了PHP中Editor::preParse方法的典型用法代码示例。如果您正苦于以下问题:PHP Editor::preParse方法的具体用法?PHP Editor::preParse怎么用?PHP Editor::preParse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Editor
的用法示例。
在下文中一共展示了Editor::preParse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: prepareDescription
/**
* Prepares a description by cutting it down to a max length, removing
* possible shebang (from editor) and other small jazzy things
*
* @param string $str
* @param string $link
* @return string
*/
protected function prepareDescription($str, $link)
{
$editor = new Editor($str);
$editor->preParse();
$editor->setContentUrl($link);
return $editor->parse(true);
}
示例2: edit
/**
* Edits an existing page
*
* @param int $pid
* @param string $title
* @param string $body
* @param int $parent
* @return bool
*/
public function edit($pid, $title, $body, $parent)
{
$page = $this->getPage($pid);
$editor = new Editor($body);
$pdoSt = $this->_sql->prepare('UPDATE {PREFIX}mod_page SET title = ?, body = ?, parent = ? WHERE id = ?');
return $pdoSt->execute(array($title, $editor->preParse(), abs($parent), $page['id']));
}
示例3: editPart
/**
* Edits an existing article part with new details
*
* @param int $pid
* @param string $title
* @param string $body
* @param int $order
* @return bool
*/
public function editPart($pid, $title, $body, $order)
{
$part = $this->getPart($pid);
$editor = new Editor($body);
$details = array('id' => $part['id'], 'article_id' => $part['article_id'], 'title' => $title, 'body' => $editor->preParse(), 'order' => abs($order));
$pdoSt = $this->_sql->prepare('UPDATE {PREFIX}mod_article_parts SET title = ?, body = ?, `order` = ?
WHERE id = ?');
if ($pdoSt->execute(array($details['title'], $details['body'], $details['order'], $details['id']))) {
Hooks::notifyAll('article_edit_part', $part['id'], $details);
} else {
return false;
}
}