本文整理汇总了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();
}
示例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());
}
示例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();
}