<?php
/**
 * Zend_Controller_Plugin_Abstract
 */
require_once 'Zend/Controller/Plugin/Abstract.php';

class Custom_Controller_Plugin_Smarty extends Zend_Controller_Plugin_Abstract
{
    public function preDispatch(Zend_Controller_Request_Abstract $request)
    {
        $module = $request->module;  //get modules value
        $view = Zend_Registry::get('smarty');
      	$view->setBasePath('./application/modules/'.$module);
    }
}