當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Editor::preParse方法代碼示例

本文整理匯總了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);
 }
開發者ID:jinshana,項目名稱:tangocms,代碼行數:15,代碼來源:Rss.php

示例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']));
 }
開發者ID:jinshana,項目名稱:tangocms,代碼行數:16,代碼來源:page.php

示例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;
        }
    }
開發者ID:jinshana,項目名稱:tangocms,代碼行數:22,代碼來源:article.php


注:本文中的Editor::preParse方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。