|
Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon. |
|
View previous topic :: View next topic |
Author |
Message |
Ben Gates Smarty Rookie
Joined: 31 Dec 2010 Posts: 7
|
Posted: Wed Jan 26, 2011 11:15 am Post subject: [SOLVED] Block Plugin not detected |
|
|
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 |
|
U.Tews Administrator
Joined: 22 Nov 2006 Posts: 5068 Location: Hamburg / Germany
|
Posted: Wed Jan 26, 2011 4:03 pm Post subject: |
|
|
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 |
|
Ben Gates Smarty Rookie
Joined: 31 Dec 2010 Posts: 7
|
Posted: Mon Feb 28, 2011 9:50 am Post subject: |
|
|
Hey !
Sorry for not replying sooner.
I deleted the compiled file. Everything works fine now. Thank you ! |
|
Back to top |
|
|
|
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
|