public function fork($id)
 {
     $snippet = Snippet::find($id);
     if (!$snippet) {
         return Redirect::to("/");
     }
     return $this->create($snippet->snippet);
 }
Exemple #2
0
function grouped_snippets()
{
    $snippets = Snippet::find(array('select' => "*", 'order' => "name ASC"));
    if ($snippets) {
        foreach ($snippets as $key => $snippet) {
            $new_array = $snippet->name[0];
            $new_sel_array[$new_array][] = array('id' => $snippet->id, 'name' => $snippet->name);
        }
        return json_decode(json_encode($new_sel_array));
    } else {
        return false;
    }
}
 function index()
 {
     $this->display('snippet/index', array('snippets' => Snippet::find(array('order' => 'position'))));
 }
Exemple #4
0
 public static function part($name)
 {
     // $sectionTitle=Snippet::find($name);
     $section_id = Snippet::whereTitle($name)->get();
     foreach ($section_id as $value) {
         $id = $value['id'];
     }
     $section = Snippet::find($id);
     //return $section->content;
     eval('?' . '>' . $section->content);
 }