示例#1
0
 /**
  * Loads an article to be included in the editing iframe.
  * 編集フレームの中に入れるのために、編集モードで記事をロードする。
  *
  * @param string $slug Unique slug of content to load
  * @return Response Article content in edit mode.
  */
 public function getIframeContent($slug)
 {
     $article = \ArticleRepository::load($slug);
     $theme = \ThemeLoader::load();
     $rendered_article = \ArticleRenderer::render($article, $theme);
     return response($rendered_article, 200);
 }
示例#2
0
 /**
  * Display the specified resource.
  *
  * @param  string $slug The slug identifier for the article
  * 
  * @return \Illuminate\Http\Response
  */
 public function show($slug)
 {
     try {
         $article = \ArticleRepository::load($slug);
         $theme = \ThemeLoader::load();
         $rendered_article = \ArticleRenderer::render($article, $theme);
         return response($rendered_article, 200);
     } catch (ArticleNotFoundException $e) {
         return response("article not found", 404);
     }
 }