public function edicion($id = null) { if (!isLogged()) { redirect('admin/inicio'); } $noticia = new Noticia(); $this->data['noticia'] = $noticia->where('id', $id)->get(); $this->data['fotos'] = $noticia->foto->get()->all; $usuarios = new UsuarioNoticia(); $this->data['usuarios'] = $usuarios->get()->all; $this->load->helper('form'); mostrarAdmin('admin/noticias/gestion', $this->data); }
public function noticia() { return Noticia::where('texto_id', $this->id)->first(); }