EE wrote:
Please help. This template thing is driving my nuts. I though maybe when
I read more articles things will clear up; however, things got even
worse. Every article writer has a different idea. Can anyone explain to
me what are Templates for? What are the advantages of using them? If I
use a third party template, will my site have a different look or is it
only a parser that will take my designed template and data and combine
them. I really don't know.

The whole idea behind templates is to separate your "business logic" from your "presentation logic". This means you have a script that does all of your processing and data retrieval, etc. This script is generally all PHP that performs your business logic. Then you have your template that only has code meant to control your presentation. This file is mostly HTML, generally, with some special template code or limited PHP thrown in to control presentation _only_. The idea is that changes to the presentation layer will not require changes to your business layer and vice-versa.


Everyone has their own ideas on whether this is needed and what kind of templates to use. There are a ton of engines out there that you can use. Some are simple and some turn into programming languages of their own and just present another layer of failure/difficulty. Some people recommend just using PHP both in your business and presentation layer as this is what PHP was originally designed for.

Personal preference. :)

--
---John Holmes...

Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/

php|architect: The Magazine for PHP Professionals – www.phparch.com

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



Reply via email to