Welcome Guest, Not a member yet? Register   Sign In
20-min-blog-tutorial - "Call to undefined function anchor() in"
#6

[eluser]muhax[/eluser]
[quote author="Shaun Andrews" date="1286997558"]Your constructor shouldnt be inside your index function. Try this:



<?php
class Blog extends Controller{
  function index(){
      $this->load->helper(‘url’);
      $this->load->helper(‘form’);

      $data[‘title’] = “My Blog Title”;
      $data[‘heading’] = “My Blog Heading”;
      $data[‘query’] = $this->db->get(‘entries’);
      
      $this->load->view(‘blog_view’, $data);
  }
}
?>

You may want to consider adding the url and form helpers to your autoloader: http://ellislab.com/codeigniter/user-gui...oader.html[/quote]

Thank you guys, it works now. That video tutorial is misleading, they should review it.


Messages In This Thread
20-min-blog-tutorial - "Call to undefined function anchor() in" - by El Forum - 10-13-2010, 08:27 AM



Theme © iAndrew 2016 - Forum software by © MyBB