For Programmers: Free Programming Magazines  


Home > Archive > PHP Smarty Templates > September 2006 > Re: [SMARTY] php pseudo frames with smarty









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Re: [SMARTY] php pseudo frames with smarty
Marc Saric

2006-09-19, 7:05 pm

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
Sponsored Links







Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive

Copyright 2008 codecomments.com