hello everyone, simple question; is it possible to register a php function as a variable (with a plugin I presume) then use it inside a template?
I have several small functions I want to be able to put on the same file and then execute them accordingly in each template or page that needs them. The other way I was doing it was just making a new file for each function (not as a function at that point of course), but it doesn't make sense to do several files when I can only do one.
I was using the following plugin sort of successfully. It would register the function fine and parse it in the template but it would display the results of the function above the header at the beginning of the page (before the vb wrapper itself) and not where I placed the vb:raw inside the template.
PHP Code:
require_once('intuitco/cotw/functions/cotw_func_print_nom.php');
$cotw_print_nominations = cotw_sotw_print_nom(true);
vB_Template::preRegister('COTW_SOTW_NOMINATIONS',array('cotw_print_nominations' => $cotw_print_nominations));
Using in this case {vb:raw cotw_print_nominations} inside my template below a sub-block way below the nav-bar, I get the results at the top of the page before the vb page, header and everything else.
If anyone can please spare a couple of minutes and explain why the output of the plugin is ending up way up there and which would be the right way of doing this I would be tremendously appreciative. Thank you for your time in advanced.
Best regards.