Feature Requests
Share ideas, discuss and vote on requests from other users in community
 
This object is in archive! 

Make smarty check for plugins in addon modules

Ryan Nolan shared this idea 3 years ago
Under Consideration

It would really make life so much easier to have smarty check the addon modules for a folder name "smarty" or something similar that would contain smarty plugins related to that addon module.

It should not make the plugin available unless the module is activated.

Comments (2)

photo
1

I agree.

photo
1

Or another idea that would be easier to implement and backwards compatable would be to create a new hook point like the example below:

  1. add_hook('RegisterSmartyFunction', 1, function($params, $smarty)
  2. {
  3. // Create Smarty Function in the way define in the smarty doc here
  4. }, "FunctionNameHere");

This would be the equivelent to:

  1. $smarty->registerPlugin("function","FunctionNameHere", function($params, $smarty)
  2. {
  3. // Create Smarty Function in the way define in the smarty doc here
  4. });

Here is the relevent smarty documentation in regards to the above suggestion:

http://www.smarty.net/docs/en/api.register.plugin.tpl