0

capitalize modifier in smarty throws error

{$payment.first_name|capitalize}

The above code throws the following error

Deprecated: preg_replace(): The /e modifier is deprecated, use preg_replace_callback instead in /home/mysuite/public_html/Demo/yoursite/includes/smarty/libs/plugins/modifier.capitalize.php on line 65

Sugumar Venkatesan
  • 4,019
  • 8
  • 46
  • 77

1 Answers1

1

You can use the php function ucwords like this.

 {$payment.first_name|ucwords}

It might not work for non latin characters (not working on cyrillic) but than you can use some library and define your new function as smarty function.

Solmyr
  • 84
  • 4