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


PHP Textile::textile方法代碼示例

本文整理匯總了PHP中Textile::textile方法的典型用法代碼示例。如果您正苦於以下問題:PHP Textile::textile方法的具體用法?PHP Textile::textile怎麽用?PHP Textile::textile使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Textile的用法示例。


在下文中一共展示了Textile::textile方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: _controllerHandler

 function _controllerHandler($pageName)
 {
     // getting post data and validating
     $pageData = $this->model->pageData_name($pageName);
     if (!$pageData || $pageData->status !== 'published') {
         Watermelon::displayNoPageFoundError();
         return;
     }
     // displaying
     $id = $pageData->id;
     $pageData->content = Textile::textile($pageData->content);
     $this->pageTitle = $pageData->title;
     $this->noHeader = true;
     $view = View('page');
     $view->page = $pageData;
     $view->commentsView = Comments::commentsView($pageData->id, 'page', '#/' . $pageName, (bool) $pageData->allowComments);
     $view->editHref = '%/pages/edit/' . $id . '?backTo=site';
     $view->deleteHref = '%/pages/trash/' . $id;
     $view->display();
 }
開發者ID:radex,項目名稱:Watermelon,代碼行數:20,代碼來源:pages.controller.php

示例2: updateFeed

 public function updateFeed()
 {
     $wmelon = Watermelon::$config;
     // composing <feed>
     $feed = new SimpleXMLElement('<?xml version="1.0" encoding="utf-8"?><feed xmlns="http://www.w3.org/2005/Atom"/>');
     $feed->id = $wmelon->atomID;
     $feed->updated = date(DATE_ATOM);
     $feed->title = strip_tags($wmelon->siteName);
     $feed->author->name = Users::userData()->nick;
     $feed->author->uri = SiteURL;
     $feed->link['rel'] = 'self';
     $feed->link['href'] = SiteURL . 'feed.atom';
     // $feed->rights
     $feed->generator = 'Watermelon';
     // adding blog posts
     $posts = Query::select('blogposts')->where('status', 'published')->order('id DESC')->limit(20)->act();
     foreach ($posts as $post) {
         $postElement = $feed->addChild('entry');
         $postElement->title = $post->title;
         $postElement->id = $post->atomID;
         $postElement->published = date(DATE_ATOM, $post->published);
         $postElement->updated = date(DATE_ATOM, $post->updated);
         $postElement->link['rel'] = 'alternate';
         $postElement->link['href'] = SiteURL . date('Y/m', $post->published) . '/' . $post->name;
         $postElement->content['type'] = 'html';
         $postElement->content = Textile::textile($post->content);
         if (!empty($post->summary)) {
             $postElement->summary['type'] = 'html';
             $postElement->summary = Textile::textile($post->summary);
         }
     }
     // save to file
     file_put_contents(CachePath . 'feed.atom', $feed->asXML());
 }
開發者ID:radex,項目名稱:Watermelon,代碼行數:34,代碼來源:blog.model.php

示例3: _post_action

 public function _post_action($name)
 {
     // getting post data
     $post = $this->model->postData_name($name);
     if (!$post) {
         Watermelon::displayNoPageFoundError();
         return;
     }
     // checking if published
     if ($post->status !== 'published') {
         // displaying notice for admin, or 'not found'
         if (Users::isLogged()) {
             $this->displayNotice('Ten wpis nie jest opublikowany. Tylko Ty go możesz zobaczyć.');
         } else {
             Watermelon::displayNoPageFoundError();
             return;
         }
     }
     // post
     $post->content = Textile::textile($post->content);
     $post->url = '#/' . date('Y/m', $post->published) . '/' . $post->name;
     // displaying (if exists)
     $id = $post->id;
     $this->pageTitle = $post->title;
     $this->noHeader = true;
     $view = View('post');
     $view->post = $post;
     $view->commentsView = Comments::commentsView($id, 'blogpost', $post->url, (bool) $post->allowComments);
     $view->editHref = '%/blog/edit/' . $id . '?backTo=post';
     $view->deleteHref = '%/blog/trash/' . $id . '/' . base64_encode('#/');
     $view->published_human = HumanDate($post->published, true, true);
     $view->display();
 }
開發者ID:radex,項目名稱:Watermelon,代碼行數:33,代碼來源:blog.controller.php


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