/** * jQuery-enable a form instance * * @param \Zend_Form $form * @return void * / public static function enableForm(\Zend_Form $form) { $form->addPrefixPath('MUtil_Bootstrap_Form_Decorator', 'MUtil/Bootstrap/Form/Decorator', 'decorator') ->addPrefixPath('MUtil_Bootstrap_Form_Element', 'MUtil/Bootstrap/Form/Element', 'element') ->addElementPrefixPath('MUtil_Bootstrap_Form_Decorator', 'MUtil/Bootstrap/Form/Decorator', 'decorator') ->addDisplayGroupPrefixPath('MUtil_Bootstrap_Form_Decorator', 'MUtil/Bootstrap/Form/Decorator'); foreach ($form->getSubForms() as $subForm) { self::enableForm($subForm); } if (null !== ($view = $form->getView())) { self::enableView($view); } } /** * Bootstrap-enable a view instance * * @param \Zend_View_Interface $view * @return void */ public static function enableView(\Zend_View_Interface $view) { if (!\MUtil_JQuery::usesJQuery($view)) { \MUtil_JQuery::enableView($view); } if (false === $view->getPluginLoader('helper')->getPaths('MUtil_Bootstrap_View_Helper')) { $view->addHelperPath('MUtil/Bootstrap/View/Helper', 'MUtil_Bootstrap_View_Helper'); } self::$_bootstrap = $view->bootstrap(); }