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>
Docs Feedback
Submit improvements, related content, or suggestions through Github.
Betterify this page