|
|
|
#1 (permalink) |
|
Messages: n/a
Hébergeur: |
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 ?? |
|
|
|
#2 (permalink) |
|
Messages: n/a
Hébergeur: |
2006/9/19, Jonathan Dray <jonathan.dray@gmail.com>:
> > 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 ?? > > > |
|
|
|
#3 (permalink) |
|
Messages: n/a
Hébergeur: |
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 |
|
![]() |
| Outils de la discussion | |
|
|