Code: Select all
<!-- DEFINE $LEFTHANDCONTENT = 'html for lhs' -->
<!-- DEFINE $RIGHTHANDCONTENT = 'html for rhs' -->
<!-- INCLUDE glassbar.html -->
Code: Select all
$RIGHTHANDCONTENT = 'html for any common stuff';
if(can quote) {
$RIGHTHANDCONTENT = $RIGHTHANDCONTENT + 'html for quote button';
}
if(can edit) {
$RIGHTHANDCONTENT = $RIGHTHANDCONTENT + 'html for edit button';
}
if(can delete) {
$RIGHTHANDCONTENT = $RIGHTHANDCONTENT + 'html for delete button';
}
i) DEFINE far more variables, say $RIGHTHANDCONTENT1 through $RIGHTHANDCONTENT10, and modify the template to concatenate them, empty or not,
or
ii) re-implement all this perfectly good template logic in PHP and template->assign_var a single string.
Neither of these strikes me as being particularly nice. My background is JSP, where I'm used to doing <c:set var ="myVar">${myVar}new stuff on the end</c:set> - am I expecting too much of the templating system here?