Fork me on GitHub

1.3: Testing for Class Presence  Bottom

  • Hi,

    in 1.3, using the new layout, we have classes which are called something like "MyModule_DBObject_MyClass" ... this is all fine and well and the autoloader works wonderfully.

    However: what is the correct way to test whether such a class exists? I basically want the 1.3 equivalent of this:

    Code

    if (!($class = Loader::loadArrayClassFromModule ('MyModule', $startpageClass))) {
                LogUtil::registerError ("blah blah blah");
                $startpageClass = 'MyClass';
            }


    Greetings/Thanks
    R
  • And of course the simplest solution is the correct one ... for some reason I wasn't convinced that class_exists would trigger the autoloader.

    Thanks
    Robert
  • 0 users

This list is based on users active over the last 60 minutes.