Welcome Guest, Not a member yet? Register   Sign In
Add $this->load->view to all functions?
#5

[eluser]InsiteFX[/eluser]
To use a MY_Controller in CI 2.0.+ from the core you need to include the following:
Code:
/*
| -------------------------------------------------------------------
|  Native Autoload - by Phil Sturgeon. New Version!
| -------------------------------------------------------------------
|
| Nothing to do with config/autoload.php, this allows PHP autoload to work
| for base controllers and some third-party libraries.
|
| If using HMVC you do not need this! HMVC will autoload.
|
| Place this code at the bottom of your application/config/config.php file.
*/
function __autoload($class)
{
    if (strpos($class, 'CI_') !== 0)
    {
        if (file_exists($file = APPPATH . 'core/' . $class . EXT))
        {
            include $file;
        }

        elseif (file_exists($file = APPPATH . 'libraries/' . $class . EXT))
        {
            include $file;
        }
    }
}

InsiteFX


Messages In This Thread
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 02:54 AM
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 03:32 AM
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 09:48 AM
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 09:56 AM
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 10:13 AM
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 10:21 AM
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 01:16 PM
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 03:06 PM
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 03:30 PM
Add $this->load->view to all functions? - by El Forum - 04-24-2011, 03:53 PM



Theme © iAndrew 2016 - Forum software by © MyBB