Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

For a software dev like me who has no idea how to create a cute hand-drawn dashed line, this course just 100% works.

— Ira Zayats, Developer

bool_string Modifier

Converts a truthy value to the string true and a falsy to the string false. Check out https://www.php.net/manual/en/language.types.boolean.php to see what PHP considers truthy and falsy.

no: 0
yes: "hell, yea"
sure: -1
{{ no | bool_string }}
{{ yes | bool_string }}
{{ sure | bool_string }}
{{ Statamic::modify($no)->boolString() }}
{{ Statamic::modify($yes)->boolString() }}
{{ Statamic::modify($sure)->boolString() }}
false
true
true
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →