0
When I have this code:
{{ 'js/gourmet.js' | static_url | script_tag }}
- What does it mean?
- Where do I find this
static_url ou o script_tag
? - This is jQuery?
0
When I have this code:
{{ 'js/gourmet.js' | static_url | script_tag }}
static_url ou o script_tag
?1
This looks like a template language. It might be Handlebars
.
Basically the double keys tell the interpreter that it is a tag and that it needs to be replaced by a valid HTML content.
There in case it probably imports a script tag with that URL.
What comes after the pipes
("|") are filters applied to the content. So it has the content js/gourmet
that passes through the filter static_url
which probably puts the rest of the URL since it is a static file and then the filter script_tag
that probably encapsulates that URL in a script tag.
In the end he must replace it with:
<script src="http://site.com/assets/js/gourmet.js" />
On the first filter it changes js/gourmet
for path
static of the file and in the second adds the tag of script
.
There are several template languages with several patterns. This double key pattern came with the Handlerbars
and has been adapted by several frameworks such as Angular
for example.
Browser other questions tagged javascript jquery html css bootstrap
You are not signed in. Login or sign up in order to post.
probably
static_url
and thescript_tag
are variable... but with only this line of code it will be difficult for anyone to help you.– andrepaulo
That would be Angular?
– celsomtrindade