Categories > TinyButStrong general >

IF in HTML

The forum is closed. Please use Stack Overflow for submitting new questions. Use tags: tinybutstrong , opentbs
By: Rromulo
Date: 2012-11-19
Time: 13:34

IF in HTML

Is possible in TBS HTML ?

[var.a;if [var.a]==[var.b];then if [var.c]==[var.d];then 'm';else 'n';then 'not']


In php

if a=b
{
if c=d
{
  echo "M";
}
else
{
  echo "N";
}
}
else
{
echo "not";
}


Thanks, Rr.
By: Skrol29
Date: 2012-11-20
Time: 01:16

Re: IF in HTML

Hi Rromulo,

In TBS it can be done with :
[var.a;if [var.a]!=[var.b];then "not";if [var.c]==[var.d];then 'M';else 'n']

Nevertheless, TBS has not to go as far as PHP can go. TBS supports only simple logical expressions. If more is need then the solution is to use complicated expression at the PHP side and save the result in a variable.
By: Rromulo
Date: 2012-11-20
Time: 14:00

Re: IF in HTML

Roger, how do I avoid the most use out programming features tbs thought that if it were away! I do not know if it would be a good idea but if count on my help!!

Thank you, R.
By: Skrol29
Date: 2012-11-22
Time: 12:23

Re: IF in HTML

>> Nevertheless, TBS has not to go as far as PHP can go

> Roger, how do I avoid the most use out programming features tbs thought that if it were away!

I meant TBS cannot go that far in the template side. You can fully use PHP in the PHP side.
By: Rromulo
Date: 2012-11-22
Time: 14:40

Re: IF in HTML

I did!! OK!! Thank you!