Categories > Your tips & tricks >

display Php constants in the template

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Skrol29
Date: 2005-01-11
Time: 11:06

display Php constants in the template

The best way to merge Php constants in your template is to use MergeField() with a user function.

HTML:
   ... [cst.constant1] ...
   ... [cst.constant2] ...
PHP:
$TBS->MergeField('cst','f_foundconstant',true);
...
function f_foundconstant($subname) {
  return constant($subname);
}

Enjoy,
By: Skrol29
Date: 2007-06-20
Time: 17:39

Re: display Php constants in the template

Since TBS 3.2.0 you can display a constant :
[var..cst.constant1]