Here is a short guide how to register vars
https://vborg.vbsupport.ru/showthread.php?t=228078
this should help you.
basically it looks like that all the time:
PHP Code:
/* render template and register variables */
$templater = vB_Template::create('mytemplate');
$templater->register('my_var', $my_var);
$templater->register('my_array', $my_array);
$templater->render();
in that case i mentioned you could edit the template "mytemplate" which you can easily create by click: ACP -> Styles und Templates -> Styles Verwalten -> Neues Template hinzufuegen
it has to have the name mytemplate, after that you can put anykind of html inside the code box, however, you could also use "my_var" as well as "my_array" in that template, because you were registering for that specific template those two vars...
if you want to print for example "my_var" you simply write {vb:raw my_var} and with the array you could do it like this: {vb:raw my_array.key} (.key represents for example, id, titel, description or whatever else : )
my small explanation doesnt mean, that you should not read that article : )
have fun