Afficher un message
Vieux 19/09/2006, 15h38   #3
Marc Saric
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: [SMARTY] php pseudo frames with smarty

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
  Réponse avec citation
 
Page generated in 0,04727 seconds with 9 queries