xPDO.loadClass

xPDO::loadClass

Load a class by fully qualified name.

The $fqn should in the format:

dir_a.dir_b.dir_c.classname

which will translate to:

XPDO_CORE_PATH/om/dir_a/dir_b/dir_c/dbtype/classname.class.php

Syntax

API Docs: http://api.modxcms.com/xpdo/xPDO.html#loadClass

string|boolean loadClass (string $fqn, [ $path = ''], [ $ignorePkg = false], [ $transient = false])

Example

Load a class from the path '/my/path/to/model/'.

$xpdo->loadClass('myBox','/my/path/to/model/');

See Also

Suggest an edit to this page on GitHub (Requires GitHub account. Opens a new window/tab) or become an editor of the MODX Documentation.