Categories > TinyButStrong general >

encrypt data

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Ronei
Date: 2010-12-07
Time: 18:47

encrypt data

Hello, I want to encrypt data when it is carrregado by TBS with base64? Is there a possibility?
By: Skrol29
Date: 2010-12-08
Time: 00:48

Re: encrypt data

Hi,

No problem.
If you want to encode the full merged template, then just do:
$TBS->Show(TBS_NOTHING);
$result  = base64_encode($TBS->Source);

If you want to encode only items before they are merged in the template, then use parameter "onformat" with a custom function.
By: Ronei
Date: 2010-12-08
Time: 02:04

Re: encrypt data

Hello Scrol 29, would like the second option using the [OnFormat ...] could give an example? As part of HTML.
By: Skrol29
Date: 2010-12-08
Time: 10:29

Re: encrypt data

Example:

PHP side:
function my_base64($name, &$val) {
  $val = base64_encode($val);
}

HTML side:
[var.x;onformat=my_base64]