Version 1, last updated by mikewill at December 29, 2009 02:26 UTC

Whizby contains a last minute class autoload function to insure classes only get included once and to use as little resources as possible by eliminating the need to check if a class exists of use require_once or include_once in the CMS. For more information about autload functions in PHP, please visit the documentation page on http://php.net/

In order for the autoload method to work, classes must follow a strict naming scheme. All classes, until the plugin system is developed, need to be located inside root/includes. No class files should be located in root/includes/core/. Depending on what type of class file you are creating will depend on the name the class needs to use, but in general for each directory you go into, not including the includes folder, you need to specify in the class name with the directory name followed by a underscore and the file name will always be the last part of the class name.

Examples:

  • Class located in root/includes/objects/
    Class Name: whizby_objects_foo
    File Name: foo.php
  • Class located in root/includes/foo/
    Class Name: whizby_foor_bar
    File Name: bar.php

Module classes are a little different and you should visit the Creating Modules Page for more information.