Welcome Guest, Not a member yet? Register   Sign In
Extanding the CI_Controller ot working
#7

[eluser]jmadsen[/eluser]
[quote author="InsiteFX" date="1353478395"]Add this to the bottom of your application/config/config.php file

Code:
/*
| -------------------------------------------------------------------------
| Native spl_autoload_register() - by Kenneth Vogt
| -------------------------------------------------------------------------
|
| Here is an updated version of Phil Sturgeon’s code:
|
| Thanks to Phil Sturgeon and Kenneth Vogt.
|
| NOTE:
| Requires PHP 5.3.+
| -------------------------------------------------------------------------
| MODIFIED by InsiteFX
| As of CI 3.0 Dev - The constant EXT has been removed modified
| to use '.php' now instead of EXT.
| should work for all version of CI and PHP 5.3
| -------------------------------------------------------------------------
| Place at the bottom of your ./application/config/config.php file.
| -------------------------------------------------------------------------
*/
spl_autoload_register(function($class)
{
if (strpos($class, 'CI_') !== 0)
{
  if (file_exists($file = APPPATH . 'core/' . $class . '.php'))
  {
   include $file;
  }
  elseif (file_exists($file = APPPATH . 'libraries/' . $class . '.php'))
  {
   include $file;
  }
}
});
[/quote]

You don't need that code - it only allows you to extend other controllers from MY_Controller & then extend from those.



Messages In This Thread
Extanding the CI_Controller ot working - by El Forum - 11-20-2012, 03:33 PM
Extanding the CI_Controller ot working - by El Forum - 11-20-2012, 04:40 PM
Extanding the CI_Controller ot working - by El Forum - 11-20-2012, 09:43 PM
Extanding the CI_Controller ot working - by El Forum - 11-20-2012, 09:58 PM
Extanding the CI_Controller ot working - by El Forum - 11-20-2012, 10:26 PM
Extanding the CI_Controller ot working - by El Forum - 11-20-2012, 11:13 PM
Extanding the CI_Controller ot working - by El Forum - 11-20-2012, 11:27 PM
Extanding the CI_Controller ot working - by El Forum - 11-20-2012, 11:53 PM
Extanding the CI_Controller ot working - by El Forum - 11-20-2012, 11:56 PM
Extanding the CI_Controller ot working - by El Forum - 11-21-2012, 12:22 AM
Extanding the CI_Controller ot working - by El Forum - 11-21-2012, 06:02 AM
Extanding the CI_Controller ot working - by El Forum - 11-21-2012, 08:11 AM
Extanding the CI_Controller ot working - by El Forum - 11-21-2012, 08:30 AM
Extanding the CI_Controller ot working - by El Forum - 11-21-2012, 09:06 AM
Extanding the CI_Controller ot working - by El Forum - 11-21-2012, 11:01 AM
Extanding the CI_Controller ot working - by El Forum - 11-21-2012, 11:36 AM



Theme © iAndrew 2016 - Forum software by © MyBB