Skip to content Skip to footer navigation
🏰 Statamic Summit 2027 Feb 16–19 Talks, workshops, and three nights in a German castle. Get Tickets

Ensure Left Modifier

Ensures that the string begins with a specified string. If it doesn't, it will now.

links:
- statamic.com
- http://wilderborn.com
{{ links }}
<li>{{ value | ensure_left('http://') }}</li>
{{ /links }}
@foreach ($links as $link)
<li>{{ Statamic::modify($link)->ensureLeft('http://') }}</li>
@endforeach
<li>http://statamic.com</li>
<li>http://wilderborn.com</li>