Attributes - Rendering
# Attributes - Rendering
Inside template files, all attributes can be accessed using the `$attributes` or `$a` variables and the respective ID of the field.
```php
```
```twig
{{ attributes.message }}
{{ a.message }}
``` Attribute values render `false` if the field is empty or no option has been selected. ```php ``` ```twig {% if a.message %}{{ a.message }}
{% endif %} ```Inside template files, all attributes can be accessed using the $attributes
or
$a
variables and the respective ID of the field.
<h1><?php echo $attributes['message']; ?></h1> <h1><?php echo $a['message']; ?></h1>
Copy
<h1><?php echo $attributes['message']; ?></h1>
<h1><?php echo $a['message']; ?></h1>
<h1>{{ attributes.message }}</h1> <h1>{{ a.message }}</h1>
Copy
<h1>{{ attributes.message }}</h1>
<h1>{{ a.message }}</h1>
Attribute values render false
if the field is empty or no option has been
selected.
<?php if ($a['message']) : ?> <h1><?php echo $a['message']; ?></h1> <?php endif; ?>
Copy
<?php if ($a['message']) : ?>
<h1><?php echo $a['message']; ?></h1>
<?php endif; ?>
{% if a.message %} <h1>{{ a.message }}</h1> {% endif %}
Copy
{% if a.message %}
<h1>{{ a.message }}</h1>
{% endif %}