Re: [SMARTY] dyamic include file variable

From: Date: Thu, 09 Jan 2003 00:26:22 +0000
Subject: Re: [SMARTY] dyamic include file variable
Groups: php.smarty.general 
Request: Send a blank email to php-smarty-general+get-7069@lists.php.net to get a copy of this message
off-topic perhaps, but I would generally advice AGAINST running your entire website out of one PHP script - it may well give you problems with client-side caching, with caching on proxies, and with cookies. what you want, though, is simply this: {include file=$Include} good luck ;) --- At 2003-01-08, 17:10:00, Darryl Bleau <darrylbleau@submersion.com> wrote: >Hi all, and a quick hello to everyone. > >This might be quite a newbie question.. I hope not, but I am relatively new to PHP in general. > >I want to use index.php in my doc root as a controller to all functionality on my web page. So, >it will handle all the business logic and assign things as required. I want it to call a >'master template' (as it were) that looks something like this: > >{config_load file=3D"site.cfg" scope=3D"global"} >{include file=3D"header.tpl"} >{include file=3D"{$Include}"} >{include file=3D"footer.tpl"} > >I think you should be able to see where I'm going with this.. I want to assign the $Include >variable in index.php according to what I want to show. (With >assign("Include","main.tpl"); or whichever page). I could just call the template >I want and put the includes at the top and bottom of each one but I was hoping I wouldn't have >to. I tried playing around with eval() to make this work but I think I'm missing something. Oh >the output I get when I try this is something like "} (and that's it). > >If anyone has an idea or a suggestion on a different way to approach this it would be >appreciated. > >Thanks, > >Darryl Bleau

« previous php.smarty.general (#7069) next »