Smart-cut string to add points

I have this code:

{if $data|@count gt 0}

  {section name=field loop=$data}

    {$data[field].description|substr:0:120}...

    <hr/>

  {/section}

{/if}

It is displayed here abc123 abc123 a....

How can I make words not cut?

+5
source share
1 answer

Why don't you use the truncate modifier http://www.smarty.net/docsv2/en/language.modifier.truncate

You can set it so as not to break the word.

+13
source

All Articles