fcf.resolvePath() function
Package: fcf-framework-core
File: fcf-framework-core:fcf.js
Available from version: 2.0.2
Converts a string containing an alias to a real path in FCF notation.
Paths that use aliases begin with the @ special character followed by the alias name up to delimiters (
If a string is passed that does not contain an alias, then the function returns the passed original. If the alias is not found, the function throws a
Arguments
- Path to a resource containing an alias
- Aliases object. The alias is the key and the value is the path.
Result
- The resulting resource path in FCF format
Example: Function application
fcf.getConfiguration().append({
aliases: {
"controls:button": "fcf-framework-controls:templates/button.tmpl",
}
});
{
let result = fcf.resolvePath("@controls:button");
console.log(result);
}
{
let result = fcf.resolvePath("@controls:button?query-arument=1");
console.log(result);
}
{
let result = fcf.resolvePath("@controls:textarea",
{"controls:textarea": "fcf-framework-controls:templates/textarea.tmpl" });
console.log(result);
}
Output:
fcf-framework-controls:templates/button.tmpl
fcf-framework-controls:templates/button.tmpl?query-arument=1
fcf-framework-controls:templates/textarea.tmpl