Get the URL for the cached fileThis automatically registers the view with Elgg's simplecache.
$blog_js = elgg_get_simplecache_url('js', 'blog/save_draft');
elgg_register_js('elgg.blog', $blog_js);
elgg_load_js('elgg.blog');
- Parameters
-
string | $type | The file type: css or js |
string | $view | The view name after css/ or js/ |
- Returns
- string
<?php
class SimpleCache {
private $CONFIG;
$this->CONFIG = $CONFIG;
}
}
}
}
} else {
$lastcache = 0;
}
}
}
}
}
}
if (!isset($this->CONFIG->views->simplecache) || !is_array($this->CONFIG->views->simplecache)) {
return false;
}
_elgg_rmdir(
"{$this->CONFIG->dataroot}views_simplecache");
mkdir("{$this->CONFIG->dataroot}views_simplecache");
$time = time();
$this->CONFIG->lastcache = $time;
return true;
}
if (!defined('UPGRADING') && empty($this->CONFIG->lastcache)) {
$this->CONFIG->lastcache = (int)
_elgg_services()->datalist->get(
'simplecache_lastupdate');
}
}
}