Fatal error: Class 'Controller' not found in <local_path>\system\application\controllers\welcome.php on line 3
<?php
class Welcome extends Controller {
function __construct()
{
parent::Controller();
}
function index()
{
$this->load->view('welcome_message');
}
}
/* End of file welcome.php */
/* Location: ./system/application/controllers/welcome.php */
I am beginner in php frameworks just extracted the CodeIgniter zip file and tried to run welcome.php controller in Aptana studio. ( PHP 5 )
No need to define constructor of class. This is the code for codeigniter 2.0 or later framework.
class Welcome extends CI_Controller {
public function index()
{
$this->load->view('welcome_message');
}
}
the problem was that I am accessing this file directly (like what 'treeface' said), but using this route generates page not found?
127.0.0.1:8000/test_ci/index.php/welcome
then I installed WAMP and used
localhost/test_ci/index.php/welcome
and this is working!
sorry for the inconvenience!
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With