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

[SOLVED] Block Plugin not detected

 
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 -> General
View previous topic :: View next topic  
Author Message
Ben Gates
Smarty Rookie


Joined: 31 Dec 2010
Posts: 7

PostPosted: Wed Jan 26, 2011 11:15 am    Post subject: [SOLVED] Block Plugin not detected Reply with quote

Hi everyone,

When I was using Smarty 2, I often used the html_table_adv block plugin that worked pretty well.
http://smarty.incutio.com/?page=HtmlTableAdvPlugin

Now I'm using Smarty3 and put the same file block.html_table_adv.php into the libs/plugins directory.

Now, I've got a "Fatal error: Call to undefined function html_table_adv() "

The only way I found to get it work was to rename the function "smarty_block_html_table_adv($params, $content, &$smarty)" to "html_table_adv($params, $content, &$smarty)" and to write the following lines into my master PHP file :


include("/var/www/library/inc/Smarty3/libs/plugins/block.html_table_adv.php");
$smarty->registerPlugin("block","html_table_adv", "html_table_adv");

That's not really comfortable... On the other hand, the documentation tells :

The plugins directory can be a string containing a path or an array containing multiple paths. To install a plugin, simply place it in one of the directories and Smarty will use it automatically.

http://www.smarty.net/docs/en/plugins.tpl

Do you know what's wrong ?

Thanks a lot,
Ben


Last edited by Ben Gates on Mon Feb 28, 2011 9:49 am; edited 1 time in total
Back to top
View user's profile Send private message
U.Tews
Administrator


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

PostPosted: Wed Jan 26, 2011 4:03 pm    Post subject: Reply with quote

There is no problem when using the orignal block.html_table_adv.php plugin file located in the lib/plugins folder. There is no need to rename and register the function.

It looks like a html_table_adv was registered when the template was compiled first and it was removed later, Note if you make modifications in your script like changing something like registering plugins you must make sure that all templates get recompiled. Smarty can not detect changes like this automatically, you should delete old cache and compiled files.
Back to top
View user's profile Send private message
Ben Gates
Smarty Rookie


Joined: 31 Dec 2010
Posts: 7

PostPosted: Mon Feb 28, 2011 9:50 am    Post subject: Reply with quote

Hey !

Sorry for not replying sooner.

I deleted the compiled file. Everything works fine now. Thank you ! Smile
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 -> General 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