I have RTFM'd and believe the answer is "No; However, I wanted to confirm that this was true. Is it present and I am missing it? Or is there a way to do something like it, that I am not catching on to?
Sincerely,
Sifmole
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I don't think that we are going to make something like CFML. So we should avoid any logic in the templates. The solution is to make a set of boolean template variables manually:
$template->param( xxx_a => ($xxx eq 'a') )
or something like this
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
In most cases (when the data source is trusted) why not simply assign the value you want to check to a boolean:
$xxx='a';
$template->param( $xxx => 1 );
and have the template do:
<TMPL_IF a>print something</TMPL_IF>
<TMPL_IF b>print something else</TMPL_IF>
OVERKILL or perhaps a last resort, is to make a nested IF-ELSE statement, or if you think it gets more readable, a nested UNLESS-ELSE!!:
<TMPL_UNLESS alpha>
<TMPL_UNLESS bravo>
<TMPL_UNLESS charley>
This is the default!
<TMPL_ELSE>
This is for charley!
</TMPL_UNLESS>
<TMPL_ELSE>
This is for bravo!
</TMPL_UNLESS>
<TMPL_ELSE>
This is for alpha!
</TMPL_UNLESS>
;-D
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi all,
I have RTFM'd and believe the answer is "No; However, I wanted to confirm that this was true. Is it present and I am missing it? Or is there a way to do something like it, that I am not catching on to?
Sincerely,
Sifmole
I don't think that we are going to make something like CFML. So we should avoid any logic in the templates. The solution is to make a set of boolean template variables manually:
$template->param( xxx_a => ($xxx eq 'a') )
or something like this
In most cases (when the data source is trusted) why not simply assign the value you want to check to a boolean:
$xxx='a';
$template->param( $xxx => 1 );
and have the template do:
<TMPL_IF a>print something</TMPL_IF>
<TMPL_IF b>print something else</TMPL_IF>
OVERKILL or perhaps a last resort, is to make a nested IF-ELSE statement, or if you think it gets more readable, a nested UNLESS-ELSE!!:
<TMPL_UNLESS alpha>
<TMPL_UNLESS bravo>
<TMPL_UNLESS charley>
This is the default!
<TMPL_ELSE>
This is for charley!
</TMPL_UNLESS>
<TMPL_ELSE>
This is for bravo!
</TMPL_UNLESS>
<TMPL_ELSE>
This is for alpha!
</TMPL_UNLESS>
;-D