private function getData()
 {
     $notModel = new Noticia_Model();
     $noticias = $notModel->getAll(array('id', 'title', 'message'));
     $comModel = new Comentarios_Model();
     $comentarios = $comModel->getAll(array('id', 'client', 'message'));
     return array('noticias' => $noticias, 'comentarios' => $comentarios);
 }
Example #2
0
 public function news()
 {
     $newsModel = new Noticia_Model();
     $noticias = $newsModel->query('SELECT id,title,message FROM ccn_news cn WHERE cn.deleted=0 ORDER BY cn.created DESC LIMIT 4');
     if ($noticias->num_rows > 0) {
         $return = array();
         while ($row = $noticias->fetch_object()) {
             $return[] = $row;
         }
     } else {
         return false;
     }
     //$noticias = $newsModel->getAll(['id', 'title', 'message']);
     echo json_encode($return);
     exit;
 }