Come fare il truncate delle stringhe con Twig?
ioclaudio
22 August 2017
Se "item.body" è la variabile che contiene il testo da troncare:
{{ item.body|length > 10 ? item.body|slice(0, 10) ~ '...' : item.body }}
- Read more about Come fare il truncate delle stringhe con Twig?
- Log in or register to post comments