I would like to create my custom helper class, but I always get ErrorException [ Fatal Error ]: Class 'media' not found when I call print media::alert();.
This is my class:
class media_Core {
public static function alert() {
return "adsfasffasdsafd";
}
}
Directory structure looks like this application/helpers/media.php. I also tried to follow these steps, but still can’t get it to work
As per the Kohana 3.3 conventions the class mappings behave like this:
media_Coremaps toapplication/classes/media/Core.phpHelpers_Mediamaps toapplication/classes/Helpers/Media.phpThe conventions page also describes style guidelines on naming your classes.
If you wish to call
media::alert(), your class must be namedmediaand be found inapplication/classes/media.php.