smarty-php / smarty

Smarty is a template engine for PHP, facilitating the separation of presentation (HTML/CSS) from application logic.
Other
2.23k stars 703 forks source link

Q/A - Smarty Plugins v4 > v5 #971

Closed ce-ju closed 4 months ago

ce-ju commented 4 months ago

Hello, first thank you for your work on Smarty (v5) @wisskid

I have read the documentation, but don't really understand how to add plugins (modifier/function) from v4 to v5.

Something with $smarty->registerPlugin(); but where do I save my plugins? In v4 I have the plugins all in the folder /includes/smarty/plugins/ which I have included with $smarty->addPluginsDir('./includes/smarty/plugins');.

But this will soon be deprecated.

Thanks!

wisskid commented 4 months ago

Sound like you want to use $smarty->addPluginsDir(). If you want to get rid of the deprecation notice that this triggers, please refer to https://smarty-php.github.io/smarty/5.x/api/extending/introduction/