[eluser]OregonGold[/eluser]
Following the blog tutorial, everything was going smooth until I got to the comment form. I followed the code step by step and im receiving this error page.
A PHP Error was encountered
Severity: Notice
Message: Undefined variable: form_open
Filename: views/comment_view.php
Line Number: 11
Fatal error: Function name must be a string in C:\wamp\www\ci\system\application\views\comment_view.php on line 11
here is the comment_view.php
Code:
<?=$form_open('blog/comment_insert');?>
<?=$form_hidden('entry_id', $this->uri->segment(3));?>
<p><textarea name="body" rows="10"></textarea></p>
<p><input type="text" name="author" /></p>
<p><input type="submit" value="Submit Comment" /></p>
</form>
and blog.php controller
Code:
<?php
class Blog extends Controller {
function Blog()
{
parent::Controller();
//$this->load->scaffolding('entries');
$this->load->helper('url');
$this->load->helper('form');
}
function index()
{
$data['title'] = "My blog title";
$data['heading'] = "My blog heading";
$data['query'] = $this->db->get('entries');
$this->load->view('blog_view', $data);
}
function comments()
{
$data['title'] = "My comment title";
$data['heading'] = "My comment heading";
$this->load->view('comment_view', $data);
}
}
?>
I even tried adding it to the autoload.php and still nothing.
Code:
$autoload['helper'] = array('url', 'form');
I dont see any problems, do you?