Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9034719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T08:33:41+00:00 2026-06-16T08:33:41+00:00

I see alot of {{#variable}} and {{/variable}} used in PHP code. Most specifically in

  • 0

I see alot of {{#variable}} and {{/variable}} used in PHP code. Most specifically in MVC and Mustache templated apps. I’ve also seen {{^variable}} and {{/variable}} used. What are they, and more importantly what are they used for?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T08:33:43+00:00Added an answer on June 16, 2026 at 8:33 am

    This is Mustache templating. You can read the docs for it here.

    {{#variable}} and {{/variable}}: Section

    Sections render blocks of text one or more times, depending on the
    value of the key in the current context.

    A section begins with a pound and ends with a slash. That is,
    {{#person}} begins a “person” section while {{/person}} ends it.

    False Values or Empty Lists

    If the person key exists and has a value of false or an empty list,
    the HTML between the pound and slash will not be displayed.

    Template:

    Shown. 
    {{#nothin}}   
      Never shown! 
    {{/nothin}}

    Hash:

    {   
        "person": true, 
    }

    Output:

    Shown.

    {{^variable}} and {{/variable}}: Inverted Section

    An inverted section begins with a caret (hat) and ends with a slash.
    That is {{^person}} begins a “person” inverted section while
    {{/person}} ends it.

    While sections can be used to render text one or more times based on
    the value of the key, inverted sections may render text once based on
    the inverse value of the key. That is, they will be rendered if the
    key doesn’t exist, is false, or is an empty list.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I see a lot of different styles of variable names used in different kind
I see a lot of people are using code under viewDidLoad to be able
I see a lot in autoconf code about stuff being dnl'ed and not dnl'ed.
I see a lot of code similar to the following var customrs = MyDataContext.Customers.Where(...);
I have seen process.nextTick used in a few places and can't quite tell what
Yes, I see the other topic: Visual Studio Debugger - Automatic Variable Assignment But
Ok, im used to see some more syntax highlighting, and the default syntax highlighting
The pimpl idiom is commonly used in order to allow changing code in dynamically
I see this a lot in some new code I've inherited: DataRow row =
A (very long) while ago I regularly used the following code - then on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.