Great thanks, I'll do that for now. Would be handy to have it built in.
Cheers,

Matthew Weier O'Phinney wrote:
-- Jack Sleight <[EMAIL PROTECTED]> wrote
(on Friday, 03 August 2007, 02:40 PM +0100):
You'll need to subclass the dispatcher, and override the
loadClass($className) method. The following should do it:

    public function loadClass($className)
    {
        $dispatchDir = $this->getDispatchDirectory();

        $loadFile    = $dispatchDir . DIRECTORY_SEPARATOR . 
$this->classToFilename($className);
        $dir         = dirname($loadFile);
        $file        = basename($loadFile);

        try {
            Zend_Loader::loadFile($file, $dir, true);
        } catch (Zend_Exception $e) {
            require_once 'Zend/Controller/Dispatcher/Exception.php';
            throw new Zend_Controller_Dispatcher_Exception('Cannot load controller 
class "' . $class
        }

        $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 
("' . $classNam
        }

        return $className;
    }

It's a minor change from the current dispatcher, and I'm thinking it
might be good to have a flag for 'alwaysUseModulePrefix' that would make
this behaviour possible. What do others think?


--
Jack

Reply via email to