I have the following code in /list.php controllers:
<?php class List extends Controller { function index() { echo "hi"; } } ?>
However, trying to access it gives me the following PHP error:
Parse error : syntax error, unexpected T_LIST, waiting for T_STRING in /var/www/sitename/htdocs/system/application/controllers/list.php on line 3
Renaming the file to "example.php" and replacing "Class List" with "class Example" works fine ... my first thought was maybe "List" was a reserved name, but I checked the list of reserved CI names here , and that not there.
I know that I can fix this problem by simply calling something else, but I really want my controller to be called a "list", if at all possible. Any ideas or insights on why this is happening?
Thanks,
Mala
php codeigniter controller reserved-words
Mala
source share