当前位置: 首页>>代码示例>>PHP>>正文


PHP Markdown::string方法代码示例

本文整理汇总了PHP中Markdown::string方法的典型用法代码示例。如果您正苦于以下问题:PHP Markdown::string方法的具体用法?PHP Markdown::string怎么用?PHP Markdown::string使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Markdown的用法示例。


在下文中一共展示了Markdown::string方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: updateExportSettings

 private function updateExportSettings()
 {
     $input = Input::only($this->export_features);
     $input['ex_disclaimer_html'] = Markdown::string($input['ex_disclaimer']);
     foreach ($input as $key => $value) {
         Setting::set($key, $value);
     }
     return true;
 }
开发者ID:l0ngestever,项目名称:logboek,代码行数:9,代码来源:SettingsController.php

示例2: run

 public function run()
 {
     /* see code below the laws */
     /* Import legal array */
     if (!@(include "./app/database/includes/legalArr.php")) {
         throw new Exception('Failed to include the legal file');
     }
     /* Import legal data */
     if (!@(include "./app/database/includes/legals.php")) {
         throw new Exception('Failed to include the legal file');
     }
     /* end legals */
     $query = DB::table('legals')->get();
     $exist = count($query);
     if ($exist == 0) {
         for ($i = 0; $i < count($legals); $i++) {
             $legals[$i]['body'] = $legal[$i];
             $legals[$i]['html_body'] = Markdown::string($legals[$i]['body']);
         }
         Legal::insert($legals);
     } elseif (count($legals) != $exist) {
         throw new Exception('Difference legal rows. Delete rows for new import.');
     }
 }
开发者ID:l0ngestever,项目名称:logboek,代码行数:24,代码来源:LegalsTableSeeder.php

示例3: update

 /**
  * Update the specified resource in storage.
  *
  * @param  int  $attachment_id
  * @return Response
  */
 public function update($legal_id)
 {
     $legal = Legal::findOrFail($legal_id);
     $legal->unguard();
     $legal->fill(Input::only('name', 'body', 'html_body', 'abbreviation', 'active'));
     $legal['html_body'] = Markdown::string($legal['body']);
     if ($legal->validate()) {
         $legal->save();
     } else {
         return View::make('legals.edit', ['legal' => $legal])->withErrors($legal->validator());
     }
     return Redirect::to(route('settings.index'))->with('message', ['content' => 'Wet met succes geupdated!', 'class' => 'success']);
 }
开发者ID:l0ngestever,项目名称:logboek,代码行数:19,代码来源:LegalsController.php

示例4: setEncryptedMessageAttribute

 public function setEncryptedMessageAttribute($value)
 {
     $this->attributes['encrypted_message'] = $value;
     $this->attributes['html_encrypted_message'] = Markdown::string($value);
 }
开发者ID:l0ngestever,项目名称:logboek,代码行数:5,代码来源:Evidence.php

示例5: setBodyAttribute

 public function setBodyAttribute($value)
 {
     $this->attributes['description'] = $value;
     $this->attributes['html_description'] = Markdown::string($value);
 }
开发者ID:l0ngestever,项目名称:logboek,代码行数:5,代码来源:Task.php

示例6: render_markdown_for_view

function render_markdown_for_view($string)
{
    return pre_content_filter(Markdown::string(htmlentities($string)));
}
开发者ID:kinnngg-lenz,项目名称:csacerc,代码行数:4,代码来源:helpers.php

示例7: getFeed

 public function getFeed(Request $request)
 {
     // create new feed
     $feed = App::make("feed");
     // cache the feed for 60 minutes (second parameter is optional)
     $feed->setCache(60, 'laravelFeedKey');
     // check if there is cached feed and build new only if is not
     if (!$feed->isCached()) {
         $default_author = 'Nono Martínez Alonso';
         // creating rss feed with our most recent articles
         $show = Config::get('writing.feed.show');
         $articles = Article::published()->public()->rss()->orderBy('published_at', 'DESC')->take($show)->get();
         // set your feed's title, description, link, pubdate and language
         $feed->title = Config::get('writing.feed.title');
         $feed->description = Config::get('writing.feed.description');
         $feed->logo = Config::get('writing.feed.logo');
         $feed->link = \URL::to('/' . Writing::path());
         $feed->setDateFormat('datetime');
         // 'datetime', 'timestamp' or 'carbon'
         $feed->pubdate = $articles[0]->published_at;
         $feed->lang = 'en';
         $feed->setShortening(false);
         // true or false
         $feed->setTextLimit(159);
         // maximum length of description text
         $feed->setView("writing::feed.rss");
         foreach ($articles as $article) {
             // set item's title, author, url, pubdate, description and content
             $imageURL = '';
             $image = '';
             if ($article->image) {
                 $image = '<p><img src="' . $article->image . '" alt="' . $article->title . '"></p>';
             }
             if ($article->video) {
                 $image = '<p><a href="' . $request->root() . '/' . Writing::path() . $article->slug . '">' . '<img src="' . \Thinker::getVideoThumb($article->video) . '" alt="' . $article->title . '"></a></p>';
             }
             if ($imageURL != '') {
                 $image = '<p><img src="' . $imageURL . '" alt="' . $article->title . '"></p>';
             }
             $feed->add($article->title, $default_author, \URL::to(Writing::path() . $article->slug), $article->published_at, '', str_replace('<img', '<img width="100%"', $image . \Markdown::string($article->text)));
         }
     }
     // first param is the feed format
     // optional: second param is cache duration (value of 0 turns off caching)
     // optional: you can set custom cache key with 3rd param as string
     //return $feed->render('atom');
     return \Response::make($feed->render('rss', -1), 200, array('Content-Type' => 'text/xml', 'Cache-Control' => 'no-cache'));
     // to return your feed as a string set second param to -1
     // $xml = $feed->render('atom', -1);
 }
开发者ID:nonoesp,项目名称:laravel-writing,代码行数:50,代码来源:WritingController.php

示例8: returnedUpdate

 public function returnedUpdate($custody_id, $custody_hash)
 {
     try {
         $custody = Custody::findOrFail($custody_id);
         if ($custody['return'] == 1 && $custody['returned'] == 0) {
             $custody->fill(Input::only(['returned_remark']));
             $custody['returned_hash'] = md5(uniqid(rand(), true));
             //Create new hash
             $custody['returned'] = 1;
             $custody['returned_remark'] = Input::get('signature_remark');
             $custody['html_returned_remark'] = Markdown::string($custody['returned_remark']);
             $custody['returned_sign'] = Input::get('signed_sign');
             $custody['returned_ip'] = Request::getClientIp();
             $custody['returned_date'] = date('Y-m-d');
             $custody['returned_time'] = date('Y-m-d H:m:s');
             if ($custody->save()) {
                 return View::make('custody.view', ['custody' => $custody]);
             }
         } else {
             if ($custody['signed'] == 1 && $custody['signature'] == 1) {
                 return Redirect::to(route('evidences.index'))->with('message', ['content' => 'Chain of Custody al retour naar opdrachtgever!', 'class' => 'danger']);
             } else {
                 return Redirect::to(route('evidences.index'))->with('message', ['content' => 'Chain of Custody kan niet worden ondertekend!', 'class' => 'danger']);
             }
         }
     } catch (ModelNotFoundException $e) {
         return Redirect::to(route('evidences.index'))->with('message', ['content' => 'Chain of Custody kan niet worden ondertekend!', 'class' => 'danger']);
     }
 }
开发者ID:l0ngestever,项目名称:logboek,代码行数:29,代码来源:CustodyController.php

示例9: update

 /**
  * Update the specified xcast in storage.
  *
  * @param  int  $id
  * @return Response
  */
 public function update($id)
 {
     $xcast = Xcast::findOrFail($id);
     $validator = Validator::make($data = Input::all(), Xcast::$rules);
     if ($validator->fails()) {
         return Redirect::back()->withErrors($validator)->withInput();
     }
     $data['rendered_notes'] = Markdown::string(Input::get('notes'));
     $xcast->update($data);
     return Redirect::route('admin.xcasts.index');
 }
开发者ID:xfyuan,项目名称:xemecasts,代码行数:17,代码来源:XcastsController.php

示例10: transformMarkdowntoHtml

/**
 * Transformación de Markdown a HTML
 *
 * @param $markdownText
 * @return string
 */
function transformMarkdowntoHtml($markdownText)
{
    return Markdown::string($markdownText);
}
开发者ID:JuaninTorres,项目名称:oa-todo,代码行数:10,代码来源:functions.php

示例11: Date

			<h1>{{ Thinker::title($article->title) }}</h1>
		@endif

		{{-- Date --}}
		<?php 
$date = new Date($article->published_at);
?>
		<p class="c-article__date">{{ ucWords($date->format('l j, F Y')); }}</p>

		{{-- Cover Image --}}
		@if ($article->image)
			<p class="c-article__cover-media"><img src="{{ $article->image }}"></p>
		@endif

		{{-- Cover Video --}}
		@if ($article->video)
			<p class="c-article__cover-media">{{ Thinker::videoWithURL($article->video) }}</p>
		@endif
		
		{{-- Text --}}
			<?php 
echo Markdown::string($article->text);
?>
		
		{{-- Tags --}}
			<p class="c-article__tags">{{ Thinker::displayArticleTags($article->tagNames(), 'c-article__tag u-case-upper') }}</p>

		{{-- Share --}}
		{{-- <p>Share on Twitter</p> --}}

</article>
开发者ID:nonoesp,项目名称:laravel-writing,代码行数:31,代码来源:c-article-old.blade.php


注:本文中的Markdown::string方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。