CodeIgniter Forums
function list() - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived General Discussion (https://forum.codeigniter.com/forumdisplay.php?fid=21)
+--- Thread: function list() (/showthread.php?tid=30723)



function list() - El Forum - 05-24-2010

[eluser]gigas10[/eluser]
Hello, not sure why codeigniter is doing this, as list is not a reserved function name.

my controller is as follows:

Code:
<?php
class Exercise extends Controller
{
    function Exercise()
    {
        parent::Controller();
    }

    function add()
    {
        $this->load->view('admin/addexercise');
    }

    function list()
    {
        $this->load->view('admin/listexercise');
    }

    function delete()
    {
        $this->load->view('admin/deleteexercise');
    }
}

When I run any of the functions in this controller, I get the following error:
Code:
Parse Error: parse error, expecting `T_STRING' in C:\wamp\www\weight\system\application\controllers\admin\exercise.php on line 13

Line 13 is the function list() line.


function list() - El Forum - 05-24-2010

[eluser]n0xie[/eluser]
list is a PHP reserved function name


function list() - El Forum - 05-24-2010

[eluser]gigas10[/eluser]
Ahhh, my fault.