/** * 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); }
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]); } }