Call to undefined function anchor() in D:\AppServ\www\blog\application\views\blog_view.ph p on line 17
no entiendo por que me muestra el error.
en la carpeta model, cree un archivo blog_model.php
Código PHP:
Ver original
class Blog_model extends CI_Model { public function __construct() { $this->load->database(); } }
dejo mi codigo blog_view.php.
Código PHP:
Ver original
class Blog extends CI_Controller { public function __construct() { parent::__construct(); $this->load->model('blog_model'); } public function Blog() { parent::Controller(); $this->load->helper('url'); $this->load->helper('form'); } public function index() { $data['title'] = "My First Page"; $data['heading'] = "My Blog Heading"; $data['query'] = $this->db->get('entries'); $this->load->view('blog_view',$data); } // añadir una entrada public function add_entry() { $data['title'] = "Add entry"; $data['heading'] = "Add a new entry"; $this->load->view('add_entry_view',$data); } public function add_entry_insert() { 'title' => $_POST['title'] , 'body' => $_POST['details'] ); $this->db->insert('entries', $data); redirect('blog/'); } public function comments() { $data['title'] = "My Comment Page"; $data['heading'] = "My Comment Heading"; $this->db->where('entry_id', $this->uri->segment(3)); $data['query'] = $this->db->get('comments'); $this->load->view('comment_view',$data); } public function comment_insert() { $this->db->insert('comments',$_POST); redirect('blog/comments/'.$_POST['entry_id']); } }
saludos.