当前位置: 首页>>代码示例>>PHP>>正文


PHP Assets::js_url方法代码示例

本文整理汇总了PHP中Assets::js_url方法的典型用法代码示例。如果您正苦于以下问题:PHP Assets::js_url方法的具体用法?PHP Assets::js_url怎么用?PHP Assets::js_url使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Assets的用法示例。


在下文中一共展示了Assets::js_url方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: _paths

 /**
  * Setup paths
  */
 private static function _paths()
 {
     // Start benchmark
     if (self::$_enable_benchmark) {
         self::$_ci->benchmark->mark("Assets::paths()_start");
     }
     // Set the assets base path
     self::$base_path = reduce_double_slashes(realpath(self::$assets_dir));
     // Now set the assets base URL
     if (!self::$base_url) {
         self::$base_url = reduce_double_slashes(config_item('base_url') . '/' . self::$assets_dir);
     } else {
         self::$base_url = self::$base_url . self::$assets_dir;
     }
     // Auto protocol
     if (stripos(self::$base_url, '//') === 0) {
         $slash = '/';
     } else {
         $slash = '';
     }
     // And finally the paths and URL's to the css and js assets
     self::$js_path = reduce_double_slashes(self::$base_path . '/' . self::$js_dir);
     self::$js_url = $slash . reduce_double_slashes(self::$base_url . '/' . self::$js_dir);
     self::$css_path = reduce_double_slashes(self::$base_path . '/' . self::$css_dir);
     self::$css_url = $slash . reduce_double_slashes(self::$base_url . '/' . self::$css_dir);
     self::$img_path = reduce_double_slashes(self::$base_path . '/' . self::$img_dir);
     self::$img_url = $slash . reduce_double_slashes(self::$base_url . '/' . self::$img_dir);
     self::$cache_path = reduce_double_slashes(self::$base_path . '/' . self::$cache_dir);
     self::$cache_url = $slash . reduce_double_slashes(self::$base_url . '/' . self::$cache_dir);
     if (!self::$freeze) {
         // Check if all directories exist
         if (!is_dir(self::$js_path)) {
             if (!@mkdir(self::$js_path, 0755)) {
                 exit('Error with JS directory.');
             }
         }
         if (!is_dir(self::$css_path)) {
             if (!@mkdir(self::$css_path, 0755)) {
                 exit('Error with CSS directory.');
             }
         }
         if (!is_dir(self::$cache_path)) {
             if (!@mkdir(self::$cache_path, 0777)) {
                 exit('Error with CACHE directory.');
             }
         }
         // Try to make the cache direcory writable
         if (is_dir(self::$cache_path) and !is_really_writable(self::$cache_path)) {
             @chmod(self::$cache_path, 0777);
         }
         // If it's still not writable throw error
         if (!is_dir(self::$cache_path) or !is_really_writable(self::$cache_path)) {
             exit('Error with CACHE directory.');
         }
     }
     // End benchmark
     if (self::$_enable_benchmark) {
         self::$_ci->benchmark->mark("Assets::paths()_end");
     }
 }
开发者ID:NaszvadiG,项目名称:Base-CodeIgniter-App,代码行数:63,代码来源:assets.php

示例2: _paths

 /**
  * Setup paths
  * @return [type] [description]
  */
 private static function _paths()
 {
     // Set the assets base path
     self::$base_path = reduce_double_slashes(realpath(self::$assets_dir));
     // Now set the assets base URL
     self::$base_url = reduce_double_slashes(config_item('base_url') . '/' . self::$assets_dir);
     // And finally the paths and URL's to the css and js assets
     self::$js_path = reduce_double_slashes(self::$base_path . '/' . self::$js_dir);
     self::$js_url = reduce_double_slashes(self::$base_url . '/' . self::$js_dir);
     self::$css_path = reduce_double_slashes(self::$base_path . '/' . self::$css_dir);
     self::$css_url = reduce_double_slashes(self::$base_url . '/' . self::$css_dir);
     self::$img_path = reduce_double_slashes(self::$base_path . '/' . self::$img_dir);
     self::$img_url = reduce_double_slashes(self::$base_url . '/' . self::$img_dir);
     self::$cache_path = reduce_double_slashes(self::$base_path . '/' . self::$cache_dir);
     self::$cache_url = reduce_double_slashes(self::$base_url . '/' . self::$cache_dir);
     // Check if all directories exist
     if (!is_dir(self::$js_path)) {
         if (!@mkdir(self::$js_path, 0755)) {
             exit('Error with JS directory.');
         }
     }
     if (!is_dir(self::$css_path)) {
         if (!@mkdir(self::$css_path, 0755)) {
             exit('Error with CSS directory.');
         }
     }
     if (!is_dir(self::$cache_path)) {
         if (!@mkdir(self::$cache_path, 0777)) {
             exit('Error with CACHE directory.');
         }
     }
     // Try to make the cache direcory writable
     if (is_dir(self::$cache_path) and !is_really_writable(self::$cache_path)) {
         @chmod(self::$cache_path, 0777);
     }
     // If it's still not writable throw error
     if (!is_dir(self::$cache_path) or !is_really_writable(self::$cache_path)) {
         exit('Error with CACHE directory.');
     }
 }
开发者ID:Autobahnpanzer,项目名称:mamrudsmuskovics,代码行数:44,代码来源:assets.php


注:本文中的Assets::js_url方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。