Skip to content

Kirby 4.5.0

$field->isTrue()

Converts the field value into a proper boolean

$field->isTrue(): bool

Return type

bool

Example

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