Exemplo n.º 1
0
 function indexer($f3)
 {
     //post loader
     $posts = new \Model\Post();
     $hasil = array_map(array($posts, 'cast'), $posts->find(array("published=? ORDER BY date_created DESC LIMIT 0,7", 1)));
     #var_dump($hasil);
     $f3->mset(array("template.title" => $f3->get("kekesed.sitename"), "template.content" => "index.html", "fpost" => $hasil[0], "posts" => array_slice($hasil, 1)));
     echo \Template::instance()->render('public/layout.php');
 }
Exemplo n.º 2
0
 function Tampil($f3)
 {
     try {
         $post = new \Model\Post();
         $hasil = $post->find(array("uniq_url = ?", $f3->get("PARAMS.id")));
         /* if($post->loaded == 0)
         			return $f3->error(404); */
         #$post = new \Model\Post($f3->get("PARAMS.id"));
     } catch (\Exception $e) {
         return $f3->error(404);
     }
     $f3->mset(array("template.title" => $hasil[0]->title . " // " . $f3->get("kekesed.sitename"), "template.content" => "entry.html", "post.cast" => $hasil[0]->cast(), "post.object" => $hasil[0]));
     echo \Template::instance()->render('public/layout.php');
 }