/** * Load a controller class * * Attempts to load the controller class file from * {@link getControllerDirectory()}. If the controller belongs to a * module, looks for the module prefix to the controller class. * * @param string $className * @return string Class name loaded * @throws Zend_Controller_Dispatcher_Exception if class not loaded */ public function loadClass($className) { $dispatchDir = $this->getDispatchDirectory(); $loadFile = $dispatchDir . DIRECTORY_SEPARATOR . $this->classToFilename($className); $dir = dirname($loadFile); $file = basename($loadFile); Zend::loadFile($file, $dir, true); if ('default' != $this->_curModule) { $className = $this->formatModuleName($this->_curModule) . '_' . $className; } if (!class_exists($className)) { require_once 'Zend/Controller/Dispatcher/Exception.php'; throw new Zend_Controller_Dispatcher_Exception('Invalid controller class ("' . $className . '")'); } return $className; }