Smarty模板引擎,如何检查字符串是否以模板中的子字符串结尾

How to check if string ends with substring from smarty3 template?

Something like:

{if string|ends_with:substring}
    String realy ends with substring
{/if}

You can use php substr:

{if ($string|substr:N:M) == "wantedSubstring"}
    ...
{/if}

where N and M are your indexes for substring.

Check substr manual for syntax.