The problem is that $notifications_menubits hasn't been set yet when your code runs (hook parse_templates). If you're using 4.1.10, there should be a hook location called process_templates_complete which you could try using instead.
Quote:
Originally Posted by clubvr4
... I read in one of the above threads that you can define some variables, like..
PHP Code:
/* Some Code, setting variables, (multidimensional) array */
$my_var = "abc";
$my_array = array(
'key1' => 'value1',
'key2' => array('
'key21' => 'value21',
'key22' => 'value22'
')
);
/* render template and register variables */
$templater = vB_Template::create('mytemplate');
$templater->register('my_var', $my_var);
$templater->register('my_array', $my_array);
$templater->render();
But i dont understand what the keys or values would/should be nor can i get my head around the above example.
|
The keys can be anything you want as long as they match what you use in the template. The values have to be variables that has a value at the time you call register() or preRegister(). I think a lot of people who are new to vb have problems because it sort of looks like there's a "language" with a set of values you can use wherever you want, but really the hook locations are specific places in the code, so the variables you have available in a plugin differ and depend on the hook location.