09-03-2009, 12:10 PM
[eluser]maicobreako[/eluser]
I was having trouble getting MY_Controller to work and ran across this thread.
My question is why does parent::__construct(); work? The only referrence to this I've seen, is this thread.
I couldn't get parent::MY_Controller(); to work in the Contact controller, I'd get this message:
"Fatal error: Call to undefined method MY_Controller::MY_Controller() in C:\wamp\winf\contact\controllers\contact.php on line 8"
BTW, using ci svn version from a few weeks ago.
/winf/contact/libraries/MY_Contoller.php
/winf/contact/controllers/contact.php
I was having trouble getting MY_Controller to work and ran across this thread.
My question is why does parent::__construct(); work? The only referrence to this I've seen, is this thread.
I couldn't get parent::MY_Controller(); to work in the Contact controller, I'd get this message:
"Fatal error: Call to undefined method MY_Controller::MY_Controller() in C:\wamp\winf\contact\controllers\contact.php on line 8"
BTW, using ci svn version from a few weeks ago.
/winf/contact/libraries/MY_Contoller.php
Code:
class MY_Controller extends Controller
{
function __construct()
{
parent::Controller();
<<snipped>>
}
}
Code:
class Contact extends MY_Controller
{
function __construct()
{
parent::__construct();
$this->load->helper(array('url', 'form', 'html'));
$this->load->library(array('form_validation', 'session'));
$this->form_validation->set_error_delimiters('<div class="error">', '</div>');
}
<<snipped>>
}