public function fork($id)
 {
     $snippet = Snippet::find($id);
     if (!$snippet) {
         return Redirect::to("/");
     }
     return $this->create($snippet->snippet);
 }
예제 #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;
    }
}
예제 #3
0
 function index()
 {
     $this->display('snippet/index', array('snippets' => Snippet::find(array('order' => 'position'))));
 }
예제 #4
0
파일: Content.php 프로젝트: BDMADE/laracms
 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);
 }