filenamize modifier


1Presentation

This Smarty modifier transforms a character string so that it can be used as a file name. It uses the filenamize() method of the \Temma\Utils\Text object.


2Usage

This modifier can take two optional parameters:

  • hyphenSpaces: (boolean) Set to false so that spaces are not replaced by hyphens.
  • lowercase: (boolean) Set to false to prevent the entire string from being converted to lowercase.

Here is an example:

<a href="/path/to/{$attachment.filename|filenamize}>Download</a>