function _js_injector_rule_path in JS injector 8
Same name and namespace in other branches
- 6.2 js_injector.module \_js_injector_rule_path()
- 7.2 js_injector.module \_js_injector_rule_path()
- 7 js_injector.module \_js_injector_rule_path()
Helper function to get file path for a rule. This will get the path relative to DRUPAL_ROOT, as in 'sites/default/files/js_injector/js_[id].js'.
Parameters
$id: The js_injector rule machine name
1 call to _js_injector_rule_path()
- js_injector_page_build in ./
js_injector.module - Implements hook_page_build().
File
- ./
js_injector.module, line 140 - js_injector.module
Code
function _js_injector_rule_path($id) {
$local_path = file_create_url(_js_injector_rule_uri($id));
// Now remove the part before the drupal root.
$local_path = preg_replace('/^' . preg_quote($GLOBALS['base_url'], '/') . '\\//', '', $local_path);
return $local_path;
}