Re: general organization question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Lists <lists@xxxxxxxxxxxxxxxx>:
> This is helpful, thanks.  But I understand most of the pieces.  I'm 
> interested in efficient and organizational factors to consider in using 
> them.  But after sending this, I thought, maybe my question is more of 
> a general structural web design question rather than PHP.
>
> I've checked google, (I'm a google researcher actually), as well as 
> O'Reilly's Safari Books online.  Most PHP books and resources I've 
> found all have so many different variations of organization, I was 
> trying to get more at the thought behind this.

I haven't had much luck with PHP books when it comes to efficient coding
techniques and site/application architecture. It's a niche that needs to
be filled.

The best book I've read so far about the subject is The Pragmatic
Programmer, which, while not PHP or web centric (pretty far from it),
gave me some great ideas about how to develop php web applications. The
bottom line is keeping code modular and flexible (and keeping it modular
generally results in keeping it flexible). This means making your
applications abstract, so that you can use metadata (config files) to
create customized applications. (This is where Rob hit it right on the
money -- more can be better, when you think of having many building
blocks -- templates -- to create an application.)

Another thing you might want to research is the MVC pattern
(Model-View-Controller) -- it has great uses in the web world, and when
I've applied it to PHP (which is pretty much all the time now), it's
greatly simplified my efforts and increased productivity.

My advice is: look into books on general programming organization; I
think you'll find a wealth of knowledge you can apply to PHP.

> On Oct 12, 2004, at 2:16 PM, Robert Cummings wrote:
>
>> On Tue, 2004-10-12 at 16:19, lists wrote:
>>> I"m wondering what factors are at play in deciding to use "require",
>>> "include", "file_get_contents" and such when laying out a site.  Like
> >
>> require() generates a fatal error if the target file doesn't exist. 
>> This
>> means your script will not attempt to continue. On the other hand,
>> include() only generates a warning and, if you know what you're doing,
>> might be convenient to choke using the @ prefix. file_get_contents()
>> ensures that the content is not parsed as PHP which is good for content
>> that might have PHP code in it that you DON'T want evaluated.
> >
>>> why use one template, or many
> >
>> Many templates allows you to build a site as though you were building a
>> car. You can have multiple engines, multiple bodies, multiple hub caps,
>> etc etc. Then using multiple templates allows you to combine them as 
>> you
>> wish with minimal effort.
> >
>>> why use different pages rather than relying on variables.
> >
>> Different pages are generally better than a single page which does
>> internal content switching based on a variable since search engine
>> crawlers can index them better... unless you're using some fancy URL
>> rewriting, but then you're just pretending to have separate pages :)
> >
>>> I'm also wondering about how I see "{content}"
>>> type stuff in phpBB and Coppermine Photo Gallery.  Does it have to 
>>> deal
>>> with customization?
> >
>> That is probably a template tag of some sort. Depending on what
>> templating system you are using there are many different, many archaic,
>> ways of telling the template engine what you want and where.
> >
>>> Anyone have any recommendations where I can learn more about this, I
>>> guess structural, stuff?


-- 
Matthew Weier O'Phinney           | mailto:matthew@xxxxxxxxxx
Webmaster and IT Specialist       | http://www.garden.org
National Gardening Association    | http://www.kidsgardening.com
802-863-5251 x156                 | http://nationalgardenmonth.org

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux