Possible Duplicate:
Reference - What does this symbol mean in PHP?
I am try somewhat unsuccessfully to run a test script for the PHP-Nemid. I am trying to work my way through the code, but have become a little lost when it gets to the render function, which makes use of the file "nemid.tpl.php". When I run the script the template file is literally written to the screen, in the sense that rather then PHP filling in the relevant template variables, it instead just writes the literal PHP code. in other words <?= $some_var_value
appears just as that in the rendered page's source code.
Another thing I don't understand is what is the meaning of the <?=
in the template file. This is not a PHP construct I am familiar with. At first I thought I should change <?= $some_var
to <? print $some_var
, but in this case it still prints the literal PHP code to the page.
Would be grateful if someone could offer me some insight into what is going on here.
Template file (nemid.tpl.php)
<html>
<body>
<form id="signedForm" name="signedForm" method="post" action="<?= $_SERVER['PHP_SELF'] ?>">
<div id="applet">
<!-- div ID used for overlay / modal-box -->
<applet name="DANID_DIGITAL_SIGNATUR" tabindex="1" archive="<?= $ServerUrlPrefix ?>/bootapplet/1234567" code="dk.pbs.applet.bootstrap.BootApplet" width="200" height="250" mayscript="mayscript" style="visibility: visible; ">
<param name="ServerUrlPrefix" value="<?= $ServerUrlPrefix ?>">
<param name="ZIP_BASE_URL" value="<?= $ZIP_BASE_URL ?>">
<param name="ZIP_FILE_ALIAS" value="<?= $ZIP_FILE_ALIAS ?>">
<param name="log_level" value="<?= $log_level ?>">
<param name="paramcert" value="<?= $paramcert ?>">
<param name="signproperties" value="<?= $signproperties ?>">
<param name="paramsdigest" value="<?= $paramsdigest ?>">
<param name="signeddigest" value="<?= $signeddigest ?>">
<param name="MAYSCRIPT" value="<?= $MAYSCRIPT ?>">
</applet>
</div>
<input type="hidden" name="signature">
<input type="hidden" name="result">
</form>
<script type="text/javascript">
function onLogonOk(signature) {
document.signedForm.signature.value=signature;
document.signedForm.result.value='ok';
document.signedForm.submit();
}
function onLogonCancel() {
document.signedForm.result.value='cancel';
document.signedForm.submit();
}
function onLogonError(emsg) {
document.signedForm.result.value=emsg;
document.signedForm.submit();
}
</script>
</body>
</html>
Render function
I have tested the contents of $vars in the below function and can confirm that the extracted variables required by the template are present.
function render($template, $vars = array())
{
extract($vars);
ob_start();
include('../templates/' . $template . '.tpl.php');
$content = ob_get_contents();
ob_end_clean();
return $content;
}