0

I have a variable in a .tpl file (smarty) The variable name is:

{$topic.url}

This variable returns a url. (It is not always the same url)

The problem: Some urls returned by this variable have accents.

Example:

http://someserver.com/forum/ántigüedad-con-énfasis

How I can do to remove all accents, and the variable return something like...

http://someserver.com/forum/antiguedad-con-enfasis

I have only access to the .tpl file, so I can not edit any php file. The solution should be added in the same .tpl file.

Thanks.

Susan
  • 1
  • 1
  • You could write a custom modifier. There are different ways to remove the accents / diacritics. see here http://stackoverflow.com/questions/3635511/remove-diacritics-from-a-string More information about custom modifiers http://www.smarty.net/docs/en/plugins.modifiers.tpl – sofl Feb 03 '15 at 11:42

1 Answers1

0
$url = 'http://someserver.com/forum/ántigüedad-con-énfasis';
$url = strtr($url, array('á' => 'a', 'ü' => 'u', 'é' => 'e'));
$smarty->assign('url', $url);
Peca
  • 1,892
  • 3
  • 20
  • 21