Пример #1
0
 private function publish_cdn()
 {
     if (cdn_info('status')) {
         $hook = hook();
         if (cdn_info('filed', 'get_static_style_url')) {
             $hook->add('get_static_style_url', function () {
                 return cdn_info('filed', 'get_static_style_url') . path_of_style() . "/" . get_style();
             });
         }
         if (cdn_info('filed', 'get_bootstrap_url')) {
             $hook->add('get_bootstrap_url', function () {
                 return cdn_info('filed', 'get_bootstrap_url');
             });
         }
         if (cdn_info('filed', 'get_bootstrap_plugin_url')) {
             $hook->add('get_bootstrap_plugin_url', function () {
                 return cdn_info('filed', 'get_bootstrap_plugin_url') . path_of_bootstrap_plugin();
             });
         }
         if (cdn_info('filed', 'get_js_url')) {
             $hook->add('get_js_url', function () {
                 return cdn_info('filed', 'get_js_url') . path_of_js();
             });
         }
     }
 }
Пример #2
0
/**
 * 获取Js目录网址
 * @return string
 */
function get_js_url()
{
    static $url = NULL;
    if ($url === NULL) {
        $url = hook()->apply("get_js_url", get_file_url() . path_of_js());
    }
    return clean_url($url . "/" . implode("/", func_get_args()) . add_src_version(func_get_args()));
}