TWIG's tests learning. Make logical judgments. Currently, divisiblebynullevenoddsameasconstantdefinedemptydivisibleby is supported to check whether it can be divisible by {% ifloop. indexisdivisibleby (3) %}... {% en for logical judgment. Currently
Pisibleby null even odd sameas constant defined empty
Pisibleby
Check whether it can be divisible
{% If loop. index is pisibleby (3) %}
...
{% Endif %}
{% If loop. index is pisibleby (3) %}
...
{% Endif %}
Null
{Var is null }}
{Var is null }}
Even
Whether the variable is an even number {var is even }}
{Var is even }}
Odd
Whether the variable is an odd number
{Var is odd }}
{Var is odd }}
Sameas
Check whether the address of the variable is the same
{% If foo. attribute is sameas (false) %}
The foo attribute really is the ''false'' PHP value
{% Endif %}
{% If foo. attribute is sameas (false) %}
The foo attribute really is the ''false'' PHP value
{% Endif %}
Constant
Check whether the value of the variable is the same
{% If post. status is constant ('post: hhed ') %}
The status attribute is exactly the same as Post: PUBLISHED
{% Endif %}
{% If post. status is constant ('post: hhed ') %}
The status attribute is exactly the same as Post: PUBLISHED
{% Endif %}
Defined
Test whether the variable is defined
{# Defined works with variable names #}
{% If foo is defined %}
...
{% Endif %}
{# And attributes on variables names #}
{% If foo. bar is defined %}
...
{% Endif %}
{% If foo ['bar'] is defined %}
...
{% Endif %}
{# Defined works with variable names #}
{% If foo is defined %}
...
{% Endif %}
{# And attributes on variables names #}
{% If foo. bar is defined %}
...
{% Endif %}
{% If foo ['bar'] is defined %}
...
{% Endif %}
Empty
Test whether the variable is null. empty indicates that the variable has been defined, but its value is null false or an empty string.
{# Evaluates to true if the foo variable is null, false, or the empty string #}
{% If foo is empty %}
...
{% Endif %}
From the column jiaochangyun
Bytes. Currently, pisibleby null even odd sameas constant defined empty pisibleby is supported to check whether it can be divisible {% if loop. index is pisibleby (3) %}... {% en...