PDA

View Full Version : Calling a variable. Simple question...well it used to be.


xms
01-01-2010, 05:24 PM
Hi All,

I have the following variable $foo which is defined in a plugin hooked on to global_start.

$foo is referred to only in the 'header' template using {vb:raw foo}.

But it isnt working. I've read enough stuff about 'registering variables' to make my head spin. But none of what I have read seems to mention where to register the variables (in the plugin, in the template, in a specific hook location????).

Help.

Thanks

Lynne
01-01-2010, 05:29 PM
You need to preregister it using a plugin that is parsed *before* the template is rendered.

vB_Template::preRegister('header', array('foo' => $foo));