Welcome Guest, Not a member yet? Register   Sign In
Global Var inside Constructor to pass to view
#6

[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
Code:
class MY_Controller extends Controller
{
    function __construct()
    {
        parent::Controller();
        <<snipped>>
    }
}
/winf/contact/controllers/contact.php
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>>
}


Messages In This Thread
Global Var inside Constructor to pass to view - by El Forum - 09-03-2009, 02:15 AM
Global Var inside Constructor to pass to view - by El Forum - 09-03-2009, 02:20 AM
Global Var inside Constructor to pass to view - by El Forum - 09-03-2009, 02:28 AM
Global Var inside Constructor to pass to view - by El Forum - 09-03-2009, 03:04 AM
Global Var inside Constructor to pass to view - by El Forum - 09-03-2009, 03:32 AM
Global Var inside Constructor to pass to view - by El Forum - 09-03-2009, 12:10 PM
Global Var inside Constructor to pass to view - by El Forum - 09-03-2009, 01:32 PM
Global Var inside Constructor to pass to view - by El Forum - 09-03-2009, 01:55 PM
Global Var inside Constructor to pass to view - by El Forum - 09-03-2009, 08:22 PM
Global Var inside Constructor to pass to view - by El Forum - 08-17-2011, 06:30 AM



Theme © iAndrew 2016 - Forum software by © MyBB