PHP Smarty Using unregistered function “urlencode” in a template is deprecated and will be removed in a future release. Use Smarty::registerPlugin to explicitly register a custom modifier

投稿者:

このエラーメッセージは、Smarty テンプレートエンジンで urlencode 関数が直接使用されていることに起因しています。urlencode は未登録のカスタム関数として扱われ、将来的に削除される予定です。そのため、Smarty でこの関数を使用する場合は、明示的にプラグインとして登録する必要があります。

Thank you for reading this post, don't forget to subscribe!

以下のように Smarty::registerPlugin を使って urlencode を登録することで、エラーを回避できます。

$smarty = new Smarty();
$smarty->registerPlugin('modifier', 'urlencode', 'urlencode');