Пример #1
0
 public function render($parameters = array())
 {
     if (isset($parameters['id'])) {
         $id = $parameters['id'];
     } else {
         throw new Exception('Fragment Widget: ID parameter missing.');
     }
     $fragment = Fragment::findOrFail($id);
     return $fragment->text;
 }
 /**
  * Returns an editor template
  * 
  * @param  int  $id The ID of the template
  * @return View
  */
 public function show($id)
 {
     // TODO: Permission check
     $template = Fragment::findOrFail($id);
     return $template->text;
 }