For the complete documentation index, see llms.txt. This page is also available as Markdown.

Auto class loading

without singleton - called Auto-loaded classes

  • create subfolder includes in plugin abc

  • create there file with name xy

  • create there class with name plugin_abc_xy

  • use new plugin_abc_xy();

See the example in the download plugin.

It works thanks to this in e107_class.php :

$tmp = explode('_', $className);
// Handler check
$tmp[0] .= '/includes'; //folder 'includes' is not part of the class name
$filename = e_PLUGIN.implode('/', $tmp).'.php';

Last updated