MiniAsset\AssetConfig::cachePath PHP Method

cachePath() public method

Accessor for getting the cachePath for a given extension.
public cachePath ( string $ext, string $path = null )
$ext string Extension to get paths for.
$path string The path to cache files using $ext to.
    public function cachePath($ext, $path = null)
    {
        if ($path === null) {
            if (isset($this->_data[$ext]['cachePath'])) {
                return $this->_data[$ext]['cachePath'];
            }
            return '';
        }
        $path = $this->_replacePathConstants($path);
        $this->_data[$ext]['cachePath'] = rtrim($path, '/') . '/';
    }

Usage Example

Example #1
0
 public function __construct(Module $modules, Module\Loader $load)
 {
     $configs = new AssetConfig($this->configs);
     if (!($cache_path = config_item('cache_path'))) {
         $cache_path = FCPATH . 'asset/cache/';
         config_item('cache_path', $cache_path);
     }
     $configs->cachePath('js', $cache_path . 'js');
     $configs->cachePath('css', $cache_path . 'css');
     foreach ($modules->getList('module') as $module) {
         $configs->set('js.paths', $module->path . 'asset/scripts/**');
         $configs->set('css.paths', $module->path . 'asset/styles/**');
     }
     $this->factory = new Factory($configs);
 }
All Usage Examples Of MiniAsset\AssetConfig::cachePath