Re: [SMARTY] php pseudo frames with smarty
| From: | Marc Saric | Date: | Tue, 19 Sep 2006 14:38:49 +0000 |
| Subject: | Re: [SMARTY] php pseudo frames with smarty | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-13476@lists.php.net to get a copy of this message | ||
Hi Jonathan,
I'm not shure your approach will work, because Smarty -beeing a templating engine- expects a complete HTML page, which is delivered by the Web-server once the display-method has been called.
Maybe I have overlooked some config-option in Smarty, but normaly you do the following:
$smarty = new Smarty();
$smarty->assign("bla", "content") # Add data to the object
$smarty->display("template.tpl") # Template is beeing processed, data from $smarty object is beeing inserted, template is converted to HTML and send to the client by the web-server.
with all variable parts going into assign-statements.
i.e.
$smarty->assign("header", "content")
$smarty->assign("body", "content")
$smarty->assign("footer", "content")
should work.
And of course you can include snippets inside the templates themselves (that's what I usualy do to split constant stuff out of HTML-pages).
Jonathan Dray wrote:
Hi I'm new to smarty and I'm trying to implement the php pseud-frames navigation system with smarty. Here is the way I'm doing it right now : $smarty->display('header.tpl'); include 'mypage.php'; $smarty->display('footer.tpl'); the include page could be any ressource like images, php file, html or other... Is it a good / bad way of doing pseudo frames with smarty ? Do you have other solutions / other navigation techniques ??-- Bye, Marc Saric