Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

3.0: Load other plugin in modifier

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> Plugins
View previous topic :: View next topic  
Author Message
Danez
Smarty Rookie


Joined: 14 Nov 2010
Posts: 5

PostPosted: Sun Nov 14, 2010 11:49 am    Post subject: 3.0: Load other plugin in modifier Reply with quote

If I want to load an other plugin in my modifier is this the right way?

Code:
<?php

$_smarty_tpl->smarty->loadPlugin('smarty_shared_make_timestamp');

function smarty_modifier_my_mod($string,$param1)
{
}

?>


The docs say:
Code:
require_once $smarty->_get_plugin_filepath('function', 'html_options');

but i do not have a $smarty variable and the function _get_plugin_filepath does not seem to exist anymore.

Thanks
Back to top
View user's profile Send private message
U.Tews
Administrator


Joined: 22 Nov 2006
Posts: 5068
Location: Hamburg / Germany

PostPosted: Sun Nov 14, 2010 2:05 pm    Post subject: Reply with quote

Your code should work. The problem is that modifier have direct access to the Smarty object.

The documentation need to be updated.
Back to top
View user's profile Send private message
geoB
Smarty Regular


Joined: 09 Sep 2010
Posts: 46

PostPosted: Sun Nov 14, 2010 2:42 pm    Post subject: Reply with quote

A very timely thread! I'd just replaced 2.6 with 3.0 and was trying solve the _get_plugin_filepath failure problem. You have the solution. Thanks for saving the few remaining hairs on my head!

g
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    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