diff --git a/doc/qweb.md b/doc/qweb.md index 3e35c5bb..918c5ec8 100644 --- a/doc/qweb.md +++ b/doc/qweb.md @@ -390,14 +390,25 @@ If an expression evaluates to a falsy value, it will not be set at all:
``` -There is another way to format a string attribute: the `t-attf-` directive. With -it, you get string interpolation: +It is sometimes convenient to format an attribute with string interpolation. In +that case, the `t-attf-` directive can be used. It is useful when we need to mix +literal and dynamic elements, such as css classes. ```xml
``` +If we need completely dynamic attribute names, then there is an additional +directive: `t-att`, which takes either an object (with keys mapping to their +values) or a pair `[key, value]`. For example: + +```xml +
+ +
+``` + ### Loops QWeb has an iteration directive `t-foreach` which take an expression returning the