Skip to content

Kirby 5.0.4

$field->isTrue()

Converts the field value into a proper boolean

$field->isTrue(): bool

Return type

bool

This method modifies the existing $field object it is applied to and returns it again.

Examples

<?php if ($page->cover()->isTrue()): ?>
<figure class="cover">
  <!-- Your code here -->
</figure>
<?php endif ?>