Moya Documentation

## IF Execute code conditionally

xml namespace
  http://moyaproject.com
defined
  /tags/context.py
library
  Moya

The IF tag executes a block of code conditionally. If the `condition` expression evaluates to `True`, then the contents of the IF tag are execute, otherwise they are skipped.

attributes
name | purpose | type | required?
--- | --- | --- | ---
condition | The inner block will be executed if this condition evaluates to True If `condition` evaluates to False, the block will be skipped. | expression | yes

inherited attributes
name | type | required?
--- | --- | ---
if | expression | no

#### Example

    <if condition=".debug">
        <echo>This only displays in debug</echo>
    </if>