require_once 'Zend/Loader.php'; Zend_Loader::loadFile('myclass.php'); $myObj = new MyClass();
require_once 'Zend/Loader.php'; Zend_Loader::loadFile('vendor/lib/myclass.php', true); $myObj = new Vendor_Lib_MyClass();In this example, we use the loadFile method to load a file from a vendor library. We set the second parameter to true to add the vendor library namespace to the autoloader. We can then use the Vendor_Lib_MyClass class in our code. Determining the package library for Zend_Loader loadFile depends on the location of the file you are trying to load. If the file is in the same directory as your PHP script, you can use a relative path. If the file is in a directory within the Zend Framework, you would use the path to the file relative to the root directory of the Zend Framework. If the file is in a vendor library, you would use the path to the file relative to the vendor directory.