当前位置: 首页>>代码示例>>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;未经允许,请勿转载。