Пример #1
0
 public function exibenoticiaAction()
 {
     $request = $this->getRequest();
     //	$user = Zend_Registry::get('zend_auth_user');
     $noticia = new Application_Model_DbTable_Noticias();
     $select = $noticia->select();
     $resultado = $select->where('idNoticias = ?', $request->getParam('noticia'))->limit(1);
     $this->view->noticia = $noticia->fetchall($resultado);
 }
Пример #2
0
 public function jsonnoticiaAction()
 {
     $noticias = new Application_Model_DbTable_Noticias();
     $tab = $noticias->fetchAll();
     $data['page'] = 1;
     $x = 0;
     foreach ($tab as $id => $row) {
         $rows[] = array("idNoticias " => $row['idNoticias'], "cell" => array($row['idNoticias'], $row['titulo'], $row['data'], $row['descricao'], $row['img']));
         $x++;
         if ($x > 50) {
             break;
         }
     }
     $data['rows'] = $rows;
     echo json_encode($data);
     exit;
 }