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

add Modifier

Add a value or another variable to your variable. Pass an integer or the name of a second variable as the parameter. Also supports + as shorthand.

books: 5
magazines: 10
{{ books | add:5 }}
{{ books | add:magazines }}
{{ books | +:magazines }}
{{-- Using Modifiers --}}
{{ Statamic::modify($books)->add(5) }}
{{ Statamic::modify($books)->add($magazines) }}
{{ Statamic::modify($books)->add($magazines) }}
 
{{-- Using PHP --}}
{{ $books + 5 }}
{{ $books + $magazines }}
{{ $books + $magazines }}
10
15
15
Docs feedback

Submit improvements, related content, or suggestions through Github.

Betterify this page →