Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Just exceptional. Thank you so much, Jack, you smashed it.

— Hugo, Developer

pad Modifier

Pad an array to a given number of items with a value. By default the value is null, but you can specify it as the second parameter.

epic_meal_time:
- jack daniels
- bacon strips
{{ epic_meal_time | pad(4, "bacon strips") }}
{{ value }}
{{ /epic_meal_time }}
<?php
$meals = Statamic::modify($epic_meal_time)
->pad(4, 'bacon strips')
->fetch();
?>
 
@foreach ($meals as $meal)
{{ $meal }}
@endforeach
jack daniels
bacon strips
bacon strips
bacon strips
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →