PDA

View Full Version : سوال: یه راه بهتر پیشنهاد کنید ! (در مورد اسمارتی)



mdssoft
پنج شنبه 23 خرداد 1387, 05:34 صبح
سلام به همگی.

بچه ها من پیش از این اگر می خواستم با Smarty چیزی شبیه این درست کنم :


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
</head>

<body>

<table id="smart" width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td>&nbsp;</td>
</tr>
</table>

<table id="smart" width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td>&nbsp;</td>
</tr>
</table>

<table id="smart" width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td>&nbsp;</td>
</tr>
</table>

<table id="smart" width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td>&nbsp;</td>
</tr>
</table>

</body>
</html>
سه فایل درست می کردم : مثلا
header.tpl
table.tpl
footer.tpl



header.tpl
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Test</title>
</head>
<body>


table.tpl
<table id="smart" width="100%" border="0" cellspacing="1" cellpadding="3">
<tr>
<td>&nbsp;</td>
</tr>
</table>

footer.tpl
</body>
</html>
بعد اول با dsiplay ، هدر رو نشون می دادم و بعد به تعداد دلخواه table.tpl رو تکرار می کردم و در آخر footer.tpl رو نشون میدادم.
می دونم بدترین راه ممکن هست ، اما من زیاد با Smarty آشنا نیستم .
می خواستم راه بهتری جلو پام بزارید ، لطفا با کد مثال بزنید.
ممنون