diff options
| author | Fabien Meghazi <fme@odoo.com> | 2016-09-07 16:01:16 +0200 |
|---|---|---|
| committer | Fabien Meghazi <fme@odoo.com> | 2016-09-09 18:03:08 +0200 |
| commit | 75f60f69416625713819c810d2da33db4dc0b06c (patch) | |
| tree | 11c1196aff2828d6619fbd36ff37a5848376ef86 /doc/reference | |
| parent | a00ea2755d93cef160a13d4652729e3c655fdbb8 (diff) | |
[ADD] web: Add extra condition branching (t-elif, t-else)
A new preprocess method is added to the template engine in order to do
preprocessing/sanitization of the templates before compilation.
This method can be overloaded in order to add new features such as
translation, ...
Diffstat (limited to 'doc/reference')
| -rw-r--r-- | doc/reference/qweb.rst | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/doc/reference/qweb.rst b/doc/reference/qweb.rst index 1fa29212998..e73de74b94d 100644 --- a/doc/reference/qweb.rst +++ b/doc/reference/qweb.rst @@ -95,6 +95,16 @@ not have to be ``<t>``:: will give the same results as the previous example. +Extra conditional branching directives ``t-elif`` and ``t-else`` are also +available:: + + <div> + <p t-if="user.birthday == today()">Happy bithday!</p> + <p t-elif="user.login == 'root'">Welcome master!</p> + <p t-else="">Welcome!</p> + </div> + + .. _reference/qweb/loops: loops |
