public function getDocumentContent($id)
 {
     $docContent = DocContent::where('doc_id', $id)->first();
     $returned = array();
     $returned['raw'] = $docContent->content;
     $returned['html'] = $docContent->html();
     return Response::json($returned);
 }
Exemple #2
0
 public function get_content($format = null)
 {
     $path = $this->get_file_path($format);
     try {
         return File::get($path);
     } catch (Illuminate\Filesystem\FileNotFoundException $e) {
         $content = DocContent::where('doc_id', '=', $this->attributes['id'])->where('parent_id')->first()->content;
         if ($format == 'html') {
             $content = Markdown::render($content);
         }
         return $content;
     }
 }