/** * Use specific helper * * @access public * @param string $helper Helper name * @return boolean * @throws FileDnxError */ static function useHelper($helper, $plugin = null) { $helper_file = Env::getHelperPath($helper, $plugin); // If we have it include, else throw exception if(is_file($helper_file)) { include_once $helper_file; return true; } else { throw new FileDnxError($helper_file, "Helper '$helper' does not exists (expected location '$helper_file')"); } // if } // useHelper
/** * Use specific helper * * @access public * @param string $helper Helper name * @return boolean * @throws FileDnxError */ static function useHelper($helper, $controller_name = null) { trace(__FILE__, "useHelper({$helper}, {$controller_name})"); $helper_file = Env::getHelperPath($helper, $controller_name); // If we have it include, else throw exception if (is_file($helper_file)) { trace(__FILE__, "useHelper({$helper}, {$controller_name}) including {$helper_file}"); include_once $helper_file; return true; } // if throw new FileDnxError($helper_file, "Helper '{$helper}' does not exists (expected location '{$helper_file}')"); }