projects
/
konrad/twig.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
(parent:
cb921ce
)
Update documentation for constant()
author
Mark Story
<mark@mark-story.com>
Fri, 11 Jan 2013 04:40:58 +0000 (23:40 -0500)
committer
Mark Story
<mark@mark-story.com>
Fri, 11 Jan 2013 04:40:58 +0000 (23:40 -0500)
doc/functions/constant.rst
patch
|
blob
|
history
diff --git
a/doc/functions/constant.rst
b/doc/functions/constant.rst
index
5b247b3
..
0fc190e
100644
(file)
--- a/
doc/functions/constant.rst
+++ b/
doc/functions/constant.rst
@@
-1,9
+1,18
@@
``constant``
============
+.. versionadded: 1.13
+ constant() now accepts object instances as the second argument.
+
``constant`` returns the constant value for a given string:
.. code-block:: jinja
{{ some_date|date(constant('DATE_W3C')) }}
{{ constant('Namespace\\Classname::CONSTANT_NAME') }}
+
+As of 1.13 you can read constants from object instances as well:
+
+.. code-block:: jinja
+
+ {{ constant('RSS', date) }}