This is just a repackage of mindplay-dk's GAutoloader https://gist.github.com/4234540
Requirements ¶
Tested with Yii 1.1.13
Install and Usage ¶
Extract under /protected/extensions/
//Add to config/main.php
//Add to Extensions
'import'=>array(...
'application.extensions.gautoloader.*'
...),
//Add to Components
'components'=>array( ....
'autoloader'=>array(
'class'=>'ext.gautoloader.EAutoloader'
),
....),
//Your Application
//Usage
Yii::app()->autoloader->getAutoloader()->addNamespace('Yournamespace\goes\here', '/path/to/namespace');
Resources ¶
Thank mindplay-dk for this fix. https://gist.github.com/4234540
Made a few mistakes it's now corrected
In EAutoloader I added:
//Before Class Declaration require('GAutoloader.php'); //function autoload //Changed return parent::autoload($className); to return Yii::autoload($className); //Bottom line changed //spl_autoload_register(array('Yii','autoload')); to spl_autoload_register(array('EAutoloader','autoload'));
If you have any questions, please ask in the forum instead.
Signup or Login in order to comment.