Ver Mensaje Individual
  #1 (permalink)  
Antiguo 07/05/2012, 14:45
esaenz22
(Desactivado)
 
Fecha de Ingreso: abril-2008
Mensajes: 787
Antigüedad: 16 años
Puntos: 7
Pregunta error: Call to undefined function anchor()

buenas tardes a todos. estoy empezando a utilizar codeigniter la version 2.0.3. me guie de un videotutorial de como hacer blog y entrradas. todo iba abien cuando al mostrarlo en el navegador, me salio este error.

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
  1. class Blog_model extends CI_Model {
  2.  
  3.     public function __construct()
  4.     {
  5.         $this->load->database();
  6.     }
  7. }

dejo mi codigo blog_view.php.

Código PHP:
Ver original
  1. class Blog extends CI_Controller
  2. {
  3.    
  4.     public function __construct()
  5.     {
  6.         parent::__construct();
  7.         $this->load->model('blog_model');
  8.     }      
  9.    
  10.     public function Blog()
  11.     {
  12.         parent::Controller();
  13.         $this->load->helper('url');
  14.         $this->load->helper('form');
  15.     }
  16.    
  17.     public function index()
  18.     {
  19.         $data['title'] = "My First Page";
  20.         $data['heading'] = "My Blog Heading";
  21.         $data['query'] = $this->db->get('entries');    
  22.         $this->load->view('blog_view',$data);
  23.     }
  24.    
  25.     // añadir una entrada
  26.     public function add_entry()
  27.     {
  28.         $data['title'] = "Add entry";
  29.         $data['heading'] = "Add a new entry";
  30.         $this->load->view('add_entry_view',$data);
  31.        
  32.     }
  33.    
  34.     public function add_entry_insert()
  35.     {
  36.         $data = array(
  37.                        'title' => $_POST['title'] ,
  38.                        'body' => $_POST['details']
  39.                     );
  40.         $this->db->insert('entries', $data);
  41.         redirect('blog/');
  42.        
  43.     }
  44.    
  45.     public function comments()
  46.     {
  47.         $data['title'] = "My Comment Page";
  48.         $data['heading'] = "My Comment Heading";
  49.         $this->db->where('entry_id', $this->uri->segment(3));
  50.         $data['query'] = $this->db->get('comments');
  51.        
  52.         $this->load->view('comment_view',$data);
  53.     }
  54.    
  55.     public function comment_insert()
  56.     {
  57.         $this->db->insert('comments',$_POST);
  58.         redirect('blog/comments/'.$_POST['entry_id']);
  59.     }
  60.    
  61. }

saludos.