In Mustache, {{.}}
is a special tag referring to the value at the top of the context stack. If you’re looping through an array, it is the current element. If you’re rendering a section with an object as context, it refers to that object.
So if your data looks like this:
{ numbers: [1, 2, 3, 4, 5], string: 'Wheee!' }
… and you’ve got a template like this:
{{# numbers }} * {{ . }} {{/ numbers }}
… it will render as this:
* 1 * 2 * 3 * 4 * 5
If your template looks like this:
{{# string }}{{ . }}{{/ string }}
… it will render as this:
Wheee!
For more on the context stack, see the Mustache.php wiki:
Edit: I just realized this tag is in the Mustache wiki, under “implicit iterator”:
Related Posts:
- What are the differences between Mustache.js and Handlebars.js?
- Using prevNext Modx Addon
- TypeError: only integer scalar arrays can be converted to a scalar index with 1D numpy indices array
- Substring in excel
- What is the difference between POST and PUT in HTTP?
- How does npm start work? What all processes are happening in the background?
- What is the := operator?
- What is Xpenology? Is it Linux related thing?
- Google Calendar API event insert always return 404 “not found” error
- Using getline() with file input in C++
- Compiler Error “void value not ignored as it ought to be” in C programming [duplicate]
- Exception in thread “AWT-EventQueue-0” java.lang.NullPointerException Error
- Different between ./ , ../ , ../../ , ~/ on file path(URL) in asp.net
- Difference between associative entity and associative relationship attribute?
- max value of integer
- How to install apoc for neo4j?
- Is there a way to get Bing’s photo of the day?
- Chrome: Uncaught SyntaxError: Unexpected end of input
- Muting a Discord user on my Server
- How do I use the yfinance API in Python to get today’s DJI open?
- Floating div positioning
- Eclipse CDT project built but “Launch Failed. Binary Not Found”
- Context Deadline Exceeded – prometheus
- When do I use the PHP constant “PHP_EOL”?
- Using $this when not in object context in PHP
- Generate pdf from HTML in div using Javascript
- new types may not be defined in a return type – C++
- What is the point of LRPC? Why would anyone want to make Remote Procedure Calls to the same machine?
- WinSCP: Permission denied. Error code: 3 Error message from server: Permission denied
- Can you use if/else conditions in CSS?
- How to record Android device’s screen on Android version below 4.4 (KitKat)
- Jenkins: 403 No valid crumb was included in the request
- class << self idiom in Ruby
- Standardize data columns in R
- IE11 prevents ActiveX from running
- How to execute AngularJS controller function on page load?
- ReactJS giving error Uncaught TypeError: Super expression must either be null or a function, not undefined
- What is O(1) space complexity?
- Windows Scheduled task succeeds but returns result 0x1
- Has the nativescript sidekick discontinue?
- How can I get a web site’s favicon?
- Why does the number of rows change during AIC in R? How to ensure that this doesn’t happen?
- org.hibernate.exception.SQLGrammarException: could not extract ResultSet
- How to fix “Setting an expiry date or a maximum age in the HTTP headers”
- How to use the command update-alternatives –config java
- What is the difference between a heuristic and an algorithm?
- Can we use & in url?
- How to sleep for five seconds in a batch file/cmd
- Printing newline in MIPS
- ffmpeg throwing “Output file #0 does not contain any stream” when trying to make a slideshow out of images
- Gnuplot line types
- omparing the contents of two files in Sublime Text
- WAMP Server – local server – 1 of 2 services running
- What is Angular Routing?
- How to find the Target *.exe file of *.appref-ms
- /lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
- What is the maximum float in Python?
- Why am I getting “Indicate whether to send a cookie in a cross-site request by specifying its SameSite attribute”?
- When should one use a ‘www’ subdomain?
- How can I completely uninstall and then reinstall Meteor.js?
- How to enable Location access programmatically in android?
- Normalizing a list of numbers in Python
- Fastest way to extract frames using ffmpeg?
- what is the difference between bisizeimage , bisize and bfsize?
- Is there an Amazon.com API to retrieve product reviews?
- Running time of algorithm A is at least O(n²) – Why is it meaningless?
- How do I check if a Key is pressed on C++
- How to not-analyze in ElasticSearch?
- Set size of WordPress thumbnail post
- Efficient Taxonomy Intersection
- Using stackexchange markup in WordPress (plugin?)
- How to reference a function from a class in a different file which is also namespaced?
- Simple JS function Not Working
- Can't get on my own web page
- Home screen width Stretch [closed]
- Hide Slider on Post Type Page
- Redirect after scrolling the page
- Create Metaboxes dynamically in admin for Pages
- How To Tell If a Custom Field Was Made with ACF, Metabox.io, Carbon Fields, Custom Built, etc?
- Plural Forms error in Query Monitor
- How to add featured image with mutiple images
- show just own posts of custom-post-type to wordpress user
- Follow author on muti-user WordPress site
- Physically locating the server
- Good tools that fit on a thumb drive [closed]
- How do you answer yes for yum install automatically
- All servers flooded by salt water, is it possible to recover data from multi-platter drives?
- How to check if I’m in screen session?
- How to zip/unzip files in Powershell?
- Cooling Server Closet – No A/C Is Possible
- Is it better practice to buy RAID disks individually vs. in bulk?
- What range of MAC addresses can I safely use for my virtual machines?
- What sysadmin things should every programmer know?
- Why do systems generally disable virtualization by default in BIOS settings?
- 10 servers to administer and I’m a history major [closed]
- Making `wget` not save the page
- How do I list all connected Salt Stack minions?
- How to get Apache2 to redirect to a subdirectory
- What does that mean: packages excluded due to repository priority protections
- How can I set a short timeout with the ping command?