By: Sean
Date: 2006-09-11
Time: 05:26
|
[var] fields does not show on sub script page.
I use TBS template calss both my main script and sub script, When I run the main script, the block on sub script can be shown normally, but the var field can't. It said:
"TinyButStrong Error in field [var.tmpsubvar...] : the PHP global variable named 'tmpsubvar' does not exist or is not set yet. This message can be cancelled using parameter 'noerr'. "
Original Code and Html:
------------main.php----------------
<?php
include_once ('tbs_class.php') ;
$subsptname='sub.php';
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('main.htm') ;
$TBS->Show() ;
?>
------------main.html----------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;">
<title>notilte</title>
</head>
<body>
[var.subsptname;script=[val];subtpl]
</body>
</html>
------------sub.php----------------
<?php
$tmpsubarray[] = array('id'=>'1111', 'name'=>'Mary') ;
$tmpsubarray[] = array('id'=>'2222', 'name'=>'Mike') ;
include_once ('tbs_class.php') ;
$tmpsubvar='Hello world';
$TBS = new clsTinyButStrong ;
$TBS->LoadTemplate('sub.htm') ;
$TBS->MergeBlock('blk1',$tmpsubarray) ;
$TBS->Show(true) ;
?>
------------sub.html----------------
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;">
<title>notile</title>
</head>
<body>
[var.tmpsubvar]
<br>
<table width="50%" border="0" align="left" cellpadding="1" cellspacing="1" class="text">
<tr bgcolor="#CACACA">
<td width="10" style="max-width:inherit"><strong>ID</strong></td>
<td width="60"><strong>Name</strong></td>
</tr>
<tr bgcolor="#F0F0F0">
<td width="10" style="max-width:inherit">[blk1.id;block=tr]</td>
<td >[blk1.name]</td>
</tr>
<tr bgcolor="#E6E6E6">
<td width="10" style="max-width:inherit">[blk1.id;block=tr]</td>
<td style="max-width:inherit">[blk1.name]</td>
</tr>
<tr bgcolor="#FFCFB9">
<td colspan="2">[blk1;block=tr;nodata]There is no data. </td>
</tr>
<tr>
<td> </td>
<td> </td>
</tr>
</table>
</body>
</html>
|