Re: [SMARTY] dyamic include file variable
| From: | Darryl Bleau | Date: | Thu, 09 Jan 2003 00:35:25 +0000 |
| Subject: | Re: [SMARTY] dyamic include file variable | ||
| References: | 1 | Groups: | php.smarty.general |
| Request: | Send a blank email to php-smarty-general+get-7070@lists.php.net to get a copy of this message | ||
Oh! Well don't I feel dumb. Expesially when I had just figured out not to
put config variables in curlies when they were already enclosed...
({$title|default:#pageTitle#}).
You would suggest a different php script for each part of the webpage? As
in, index.php, /users/user.php, /news/news.php, ect? I was sort of liking
the 'never leave index' stype, I remember having a look at some Java-style
MVC and it did go like that (everything from one controller), however in
that case it also ended up having URLs like site.com/control/news and
site.com/control/user, which made it look like it was accessing directories
when it really wasn't. Hmm. Also if memory serves doesn't phpShop run like
this as well? Not that it matters I suppose. What sort of issues do you
envision me having? If this is offtopic for the list I'm sorry. I'm just
starting the project and I don't want to get off on the wrong foot :) (I
evaluated all sorts of TEs for PHP and I have to say I think Smarty is the
best, no contest!).
Thanks!
----- Original Message -----
From: "Rasmus Schultz" <m@mindplay.dk>
To: "Smarty List" <smarty-general@lists.php.net>
Sent: Wednesday, January 08, 2003 5:26 PM
Subject: Re: [SMARTY] dyamic include file variable
> 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
>
>
>
>
> --
> Smarty General Mailing List (http://smarty.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>