Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Plugins smarty 2->3 migration issue

 
Post new topic   Reply to topic    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
alexlehm
Smarty n00b


Joined: 10 Feb 2012
Posts: 1

PostPosted: Fri Feb 10, 2012 12:40 pm    Post subject: Plugins smarty 2->3 migration issue Reply with quote

I had an issue when migrating my code from Smarty 2 to Smarty 3.1, I wonder if this is properly explained in the documentation:

in Smarty 2 the apparently common way to set a plugin dir was

$smarty->plugins_dir[] = '...';

this used to set a user plugin dir and kept smarty's own plugin dir in the list.

in Smarty 3.1 the variable plugins_dir is no longer accessible, so I figured the obvious replace is setPluginDir, however this overwrites the directory already set for the smarty plugins, removing escape etc.

The correct solution is to use addPluginDir, but that isn't obvious from the documentation.
Back to top
View user's profile Send private message
noiselabs
Smarty n00b


Joined: 04 Dec 2011
Posts: 4

PostPosted: Sun Feb 12, 2012 2:39 am    Post subject: Reply with quote

You are right. addPluginsDir() is the way to go.

There is a note about the migration to 3.1 and the deprecation of $plugins_dir[] usage here.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Plugins All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP