Radical Design Course by Jack McDade

From the creator of Statamic

Learn how to make your websites standout and be remembered.

Bought Jack McDade's course on design. Going through it now...and it is SO well done!

— Justin Jackson, Transistor.fm

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 →