Log in

View Full Version : how to "export" a variable to template?


sandman1970
03-29-2005, 09:52 PM
hi,

generally i need answer for the question in the title :)

here is my problem:

in file showthread.php i set up a variable $threadBelongsToForumA. I dont know how to "export" this varialbe in order i can use "if conditional" syntax in SHOWTHREAD template:

<if condition="$threadBelongsToForumA==1">....</if>

my php and VB know-how is very limited, pls help. Thx a lot.

Zachery
03-29-2005, 11:57 PM
hi,

generally i need answer for the question in the title :)

here is my problem:

in file showthread.php i set up a variable $threadBelongsToForumA. I dont know how to "export" this varialbe in order i can use "if conditional" syntax in SHOWTHREAD template:

<if condition="$threadBelongsToForumA==1">....</if>

my php and VB know-how is very limited, pls help. Thx a lot.
where did you setup this "varible"

sandman1970
03-30-2005, 12:36 AM
hi,

in file showthread.php

Adrian Schneider
03-30-2005, 01:29 AM
If I am understanding your question correctly, if the file containing the variable is run, it should recognize it automatically. :)

ex: if you declare $hello = 'hello'; in showthread.php

then putting $hello in a template will show $hello if the current file is showthread.php (or it is included).

Zachery
03-30-2005, 01:30 AM
hi,

in file showthread.php
ok, then if you set $var in showthreadm then you can use it in a showthread template, infact any template that comes after the varible is defined.