Ad

How The First Word Of The Sentence To Put In The Span

I use laravel with blade. I do not know how the first word from record.title put in span. Does anyone know and can help me? Edit: I forgot the most important thing. This is a htm page from cms october

<h2><span>The</span> {{ record.title }}</h2>
Ad

Answer

October CMS is using the twig template engine. you can do it in your template:

{{ record.title | split(' ')[0] }}
// for the rest of string 
{{ record.title[1:] }}
Ad
source: stackoverflow.com
Ad