本文整理汇总了PHP中Assets::assets_dir方法的典型用法代码示例。如果您正苦于以下问题:PHP Assets::assets_dir方法的具体用法?PHP Assets::assets_dir怎么用?PHP Assets::assets_dir使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Assets
的用法示例。
在下文中一共展示了Assets::assets_dir方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: set_path
/**
* Set a different assets path
* @param string $path
*/
public static function set_path($path = null)
{
self::init();
if ($path) {
self::$assets_dir = $path;
}
self::_paths();
}
示例2: __construct
/**
* Constructor
*
* @return void
*/
public function __construct()
{
/*
* Instanciar codeigniter
*/
$this->ci =& get_instance();
/*
* Cragar helper url
*/
$this->ci->load->helper('url');
/*
* Cargar variable global CSRF
*/
self::agregar_var_js(array('tkn' => $this->ci->security->get_csrf_hash()));
$config = $this->ci->load->config('minify', TRUE, TRUE);
/**
* Inicializar
* Minify LibraryClass.
*/
// user specified settings from config file
self::$assets_dir = $this->ci->config->item('assets_dir', 'minify') ?: self::$assets_dir;
self::$css_dir = $this->ci->config->item('css_dir', 'minify') ?: self::$css_dir;
self::$js_dir = $this->ci->config->item('js_dir', 'minify') ?: self::$js_dir;
self::$css_file = $this->ci->config->item('css_file', 'minify') ?: self::$css_file;
self::$js_file = $this->ci->config->item('js_file', 'minify') ?: self::$js_file;
self::$auto_names = $this->ci->config->item('auto_names', 'minify') ?: self::$auto_names;
self::$compress = $this->ci->config->item('compress', 'minify') ?: self::$compress;
self::$compression_engine = $this->ci->config->item('compression_engine', 'minify') ?: self::$compression_engine;
//$this->closurecompiler = $this->ci->config->item('closurecompiler', 'minify');
if (count($config) > 0) {
// custom config array
foreach ($config as $key => $val) {
if (isset($this->{$key})) {
$this->{$key} = $val;
}
}
}
// perform checks
$this->_config_checks();
}
示例3: setPath
/**
* Sets path to the assets directory
* @param string $path
* @return bool
* @throws \Assets\AssetsException
* @internal param string $dir
*/
public static function setPath($path = '')
{
// Directory Exist?
if (!is_dir($path)) {
throw new Assets\AssetsException('The provided directory "' . $path . '" does not exist.');
}
// Set path
self::$assets_dir = $path;
}