<?php

require_once 'Zend/Controller/Plugin/Abstract.php';

/**
 * Auto add module model directory to include_path
 */
class Fiktiv_Controller_Plugin_ModelAutoloader extends Zend_Controller_Plugin_Abstract
{
    public function  preDispatch(Zend_Controller_Request_Abstract $request) {

        $front = Zend_Controller_Front::getInstance();
        
        set_include_path(implode(PATH_SEPARATOR, array(
            $front->getModuleDirectory() . '/models',
            get_include_path()
        )));

    }
}
