1.3. Zend::loadClass()
Prev | Chapter 1. Zend | Next

## 1.3. Zend::loadClass()

`Zend::loadClass()` loads a PHP file whose filename is formatted like "`$className.php`", and then checks for the existance of the class `$className`.

    <?php

    Zend::loadClass($class, $dirs)

    ?>

If the file is not found or the class does not exist after the load, a `Zend_Exception` is thrown. `Zend::loadFile()` is used for loading, and the `$dirs` argument is passed directly to it..

If you ask for a class with underscores in the name, and `$dirs` is null (the default), `Zend::loadClass()` will auto-discover the `$dirs` from the class name by converting underscores to directory separators. For example, if `$class` is `Zend_Example_Class`, that will map to a path of `Zend/Example/Class.php`.

Prev | Up | Next
1.2. Zend::loadFile() | Home | 1.4. Zend::isReadable()