Re: Re: template and file read
| From: | EE | Date: | Wed, 21 Jul 2004 15:59:10 +0000 |
| Subject: | Re: Re: template and file read | ||
| References: | 1 2 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-191334@lists.php.net to get a copy of this message | ||
On Tue, 2004-07-20 at 23:08, Jason Barnett wrote:
> Ee wrote:
>
> > Dears,
> >
> > In one of the tutorials I read about templates, the writer is diving the
> > code into multiple files. He put the menu, main, left, right, footer
> > each in a separate file. He is using foreach to go through an array and
> > reads all these files.
> >
> > Is this a good practice?
>
> I use a lot of includes in most of my scripts mostly for logical seperation of
> libraries. So IMHO yes, that is a good practice. However I wouldn't bother
> using a foreach to include each file if I know ahead of time what files I'm
> going to need to call.
>
> > Would this slow down the site?
>
> Absolutely! Include(s) and Require(s) are some of the most expensive calls to
> make, however that can be mitigated by using a compiler cache. Google or check
> the list archives for some "PHP cache" suggestions.
Is the compiler cache a function of the my web host or my code?