php in to .tpl

calj

No avatar

2006-10-09 19:58

Hi,

I understand that I cant put php directly into a .tpl file. I am have a few problems creating a tag to go in to the order_basket.tpl to run my small php snippet.

I want the next>> button to only show under certain circumstances. The code I am using is :


<?php
$test_value 
$aList[fSummary];
$hour date("H");
if (
$hour>12)
  echo 
"<img src=\"templates/img/finished.gif\" width=\"80\" height=\"16\" />"
elseif (
$test_value>1.59)
  echo 
"<fieldset><input type=\"submit\" name=\"sSave\" value=\"Buy Now &raquo;\" class=\"submit\

/></fieldset>"

else
  echo 
"<img src=\"templates/img/min_value.gif\" width=\"80\" height=\"16\" />"
?>



would someone be able to tell me how to process the php external to the .tpl file and then pull in the result please.

Best regards,

Callum

treewood (OpenSolution)

Avatar: treewood

2006-10-10 10:10

calj - change echo to $sVariable and put this variable $sVariable in some tpl for example templates/page.tpl to see result

Back to top
about us | contact