CodeIgniter Forums
undefined constant load - Printable Version

+- CodeIgniter Forums (https://forum.codeigniter.com)
+-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20)
+--- Forum: Archived Development & Programming (https://forum.codeigniter.com/forumdisplay.php?fid=23)
+--- Thread: undefined constant load (/showthread.php?tid=57178)



undefined constant load - El Forum - 02-22-2013

[eluser]davy_yg[/eluser]
I have this code:

Controllers/login.php

Code:
<?php

class Login extends CI_Controller {

function index()
{
  $data['main_content'] = 'login_form';
  $this-load-view('includes/template', $data);
}
}


?>

This error appears:


A PHP Error was encountered

Severity: Notice

Message: Use of undefined constant load - assumed 'load'

Filename: controllers/login.php

Line Number: 10
A PHP Error was encountered

Severity: Notice

Message: Object of class Login could not be converted to int

Filename: controllers/login.php

Line Number: 10

Fatal error: Call to undefined function view() in C:\xampp\htdocs\Codeigniter_213-d6\application\controllers\login.php on line 10


Why is it?

Thanks.


undefined constant load - El Forum - 02-23-2013

[eluser]Jan_1[/eluser]
but it's not your little mistake to write
Code:
$this-load-view('includes/template', $data);
instead of
Code:
$this->load->view('includes/template', $data);
?