Skip to content
Umakant Patil edited this page Aug 14, 2017 · 1 revision

spacify is a way to insert a space between every character of a variable. You can optionally pass a different character or string to insert.

Parameter Position Type Required Default Description
1 string No one space This what gets inserted between each character of the variable.

Template:

{$articleTitle = 'Lets Learn.'}

{$articleTitle}
{$articleTitle|spacify}
{$articleTitle|spacify:"^^"}

output:

Lets Learn.
L e t s  L e a r n .
L^^e^^t^^s^^^^L^^e^^a^^r^^n^^.

see also spaceify in PHP Smarty documentation.

Clone this wiki locally