Ejemplo n.º 1
0
 /**
  * Print latest 3 news
  * @return void
  */
 public function block_news()
 {
     // Creating instance of model and fetching data
     $news = new News_Model();
     $data = $news->get(1, 3);
     // creating view
     $template = new View('block_news');
     $template->data = $data;
     $template->render(TRUE);
 }
Ejemplo n.º 2
0
 public function delete(Request $request, Response $response)
 {
     if ($request->is_post()) {
         $ids = $request->post('rids');
         $ret = News_Model::delete($ids);
         $response->sendJSON(['flag' => 'OK', 'rids' => $ret]);
     }
 }