Smarty Question !!!
-
Hi friends.
I usually use Smarty to create templates.When I wanted to create somethings like this :
<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>
<tr>
<td> </td>
</tr>
</table><table>
<tr>
<td> </td>
</tr>
</table><table>
<tr>
<td> </td>
</tr>
</table><table>
<tr>
<td> </td>
</tr>
</table></body>
</html>I created three files ( for example Header.tpl , Footer.tpl , Body.tpl )
Header.tpl :
<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>Body.tpl :
<table>
<tr>
<td> </td>
</tr>
</table>Footer.tpl :
</body>
</html>Then I wrote this Smarty code in PHP to created above HTML file :
$smarty -> display('Header.tpl');
for ($i=0; $i<=3; $i++)
$smarty -> display('Body.tpl');
$smarty -> display('Footer.tpl');This way is bad, because designing template is very difficult.
Are there any ways to use Smarty and create above HTML file.
Thanks in advanceSorry for my English. I'm a freshman .
-
Hi friends.
I usually use Smarty to create templates.When I wanted to create somethings like this :
<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>
<tr>
<td> </td>
</tr>
</table><table>
<tr>
<td> </td>
</tr>
</table><table>
<tr>
<td> </td>
</tr>
</table><table>
<tr>
<td> </td>
</tr>
</table></body>
</html>I created three files ( for example Header.tpl , Footer.tpl , Body.tpl )
Header.tpl :
<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>Body.tpl :
<table>
<tr>
<td> </td>
</tr>
</table>Footer.tpl :
</body>
</html>Then I wrote this Smarty code in PHP to created above HTML file :
$smarty -> display('Header.tpl');
for ($i=0; $i<=3; $i++)
$smarty -> display('Body.tpl');
$smarty -> display('Footer.tpl');This way is bad, because designing template is very difficult.
Are there any ways to use Smarty and create above HTML file.
Thanks in advanceSorry for my English. I'm a freshman .
Can't you just output the HTML? It doesn't stop normal PHP from working.
Brad Australian The PHP MVP - Christian Graus on "Best books for VBscript" A big thick one, so you can whack yourself on the head with it.
-
Can't you just output the HTML? It doesn't stop normal PHP from working.
Brad Australian The PHP MVP - Christian Graus on "Best books for VBscript" A big thick one, so you can whack yourself on the head with it.
Thanks Bradml.
Bradml wrote:
Can't you just output the HTML?
Yes, I can. but I want generate output by SMARTY ! :^)
Sorry for my English. I'm a freshman .
-
Thanks Bradml.
Bradml wrote:
Can't you just output the HTML?
Yes, I can. but I want generate output by SMARTY ! :^)
Sorry for my English. I'm a freshman .
.... why? What benefit does that provide?
Brad Australian The PHP MVP - Christian Graus on "Best books for VBscript" A big thick one, so you can whack yourself on the head with it.
-
.... why? What benefit does that provide?
Brad Australian The PHP MVP - Christian Graus on "Best books for VBscript" A big thick one, so you can whack yourself on the head with it.
Bradml wrote:
What benefit does that provide?
With Smarty you can sift Template through program , so we can change template easily.
Sorry for my English. I'm a freshman .
-
Bradml wrote:
What benefit does that provide?
With Smarty you can sift Template through program , so we can change template easily.
Sorry for my English. I'm a freshman .
Ok, well sorry I haven't really looked into Smarty so I'm not going to be of too much help. Check out the Smarty Forums[^]. They can probably help you out.
Brad Australian The PHP MVP - Christian Graus on "Best books for VBscript" A big thick one, so you can whack yourself on the head with it.
-
Ok, well sorry I haven't really looked into Smarty so I'm not going to be of too much help. Check out the Smarty Forums[^]. They can probably help you out.
Brad Australian The PHP MVP - Christian Graus on "Best books for VBscript" A big thick one, so you can whack yourself on the head with it.
OK, That's all right. Thanks
Sorry for my English. I'm a freshman .