projects
/
web/konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
c03a7a3
)
added more docs for the if tag
author
Fabien Potencier
<fabien.potencier@gmail.com>
Fri, 1 Aug 2014 07:38:44 +0000 (09:38 +0200)
committer
Fabien Potencier
<fabien.potencier@gmail.com>
Fri, 1 Aug 2014 07:38:44 +0000 (09:38 +0200)
doc/tags/if.rst
patch
|
blob
|
history
diff --git
a/doc/tags/if.rst
b/doc/tags/if.rst
index
d7a1451
..
6c9ac67
100644
(file)
--- a/
doc/tags/if.rst
+++ b/
doc/tags/if.rst
@@
-41,3
+41,20
@@
more complex ``expressions`` there too:
{% else %}
Kenny looks okay --- so far
{% endif %}
+
+.. note::
+
+ The rules to determine if an expression is ``true`` or ``false`` are the
+ same as in PHP; here are the edge cases rules:
+
+ ======= ====================
+ Value Boolean evaluation
+ ======= ====================
+ empty string false
+ numeric zero false
+ whitespace-only string true
+ empty array false
+ null false
+ non-empty array true
+ object true
+ ======= ====================