RE: [PHP] Website templating schemes

2003-08-27 Thread Joel Konkle-Parker
Quoting Chris W. Parker [EMAIL PROTECTED]:
 And I completely don't understand Option #2. What does body() do and
 why
 do you call it? Can you show some pseudo code to help us (or maybe
 it's
 just me) understand how Option #2 works?

Browser calls index.php

--
#index.php

programming tasks..

$results = results of above;

function body() {
  # info, content, etc.
  global $results;
  echo $results;
}

require template.php;
--

--
#template.php

prints header stuff

body();

prints footer stuff
--

Does that make any sense?


-- 
Joel Konkle-Parker
Webmaster [Ballsome.com]

Phone [662-518-1636]
E-mail[EMAIL PROTECTED]

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



Re: [PHP] Website templating schemes

2003-08-27 Thread Joel Konkle-Parker
 With method 2 it seems like your template file would become redundant
 because every one of them would have to contain the header and footer
 code.
 
 I would use 3 template files, header.php, footer.php, and
 body_index.php
 
 index.php would:
 
 1. PERFORM LOGIC
 2. include header
 3. include body
 4. include footer
 
 Then, all you have to do is make new body_XXX.php files for each page
 on
 your site and the header/footer content is contained in one place.

Ok, wait, I'm having a hard time understanding this... the browser would request
the same index.php every time? with server.com/index.php?query_string? And the
query string would determine the body_XXX.php to be included?

Right now I have it set up so that a different index.php is requested each time,
 but calls the same template.php.

-- 
Joel Konkle-Parker
Webmaster [Ballsome.com]

Phone [662-518-1636]
E-mail[EMAIL PROTECTED]

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



RE: [PHP] Website templating schemes

2003-08-27 Thread Chris W. Parker
Joel Konkle-Parker mailto:[EMAIL PROTECTED]
on Tuesday, August 26, 2003 1:51 PM said:

 Does that make any sense?

Yes, and that's what I kind of thought you meant but just couldn't
envision it completely.


Chris.

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



[PHP] Website templating schemes

2003-08-26 Thread Joel Konkle-Parker
I'm trying to make a PHP-backed website, and I'm trying to decide between two
templating schemes:

1. define 2 php template files: header.php, footer.php. in index.php, require
header.php, output content, require footer.php

2. define a php template file and a local page file. index.php defines body()
and crequires template.php. template.php prints the header, calls body() to
print the content, and and prints the footer.

I'm currently using the second method, but I've only seen the first used
elsewhere. Is there a reason that #1 is better than #2 (or is anything else even
better than that?)?


--
Joel Konkle-Parker
Webmaster [Ballsome.com]

Phone [662-518-1636]
E-mail[EMAIL PROTECTED]

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



RE: [PHP] Website templating schemes

2003-08-26 Thread Chris W. Parker
Joel Konkle-Parker mailto:[EMAIL PROTECTED]
on Tuesday, August 26, 2003 9:26 AM said:

 I'm currently using the second method, but I've only seen the first
 used elsewhere. Is there a reason that #1 is better than #2 (or is
 anything else even better than that?)?

Thought about using Smarty? http://smarty.php.net

And I completely don't understand Option #2. What does body() do and why
do you call it? Can you show some pseudo code to help us (or maybe it's
just me) understand how Option #2 works?


Chris.

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



Re: [PHP] Website templating schemes

2003-08-26 Thread CPT John W. Holmes
From: Joel Konkle-Parker [EMAIL PROTECTED]


 I'm trying to make a PHP-backed website, and I'm trying to decide between
two
 templating schemes:

 1. define 2 php template files: header.php, footer.php. in index.php,
require
 header.php, output content, require footer.php

 2. define a php template file and a local page file. index.php defines
body()
 and crequires template.php. template.php prints the header, calls body()
to
 print the content, and and prints the footer.

 I'm currently using the second method, but I've only seen the first used
 elsewhere. Is there a reason that #1 is better than #2 (or is anything
else even
 better than that?)?

With method 2 it seems like your template file would become redundant
because every one of them would have to contain the header and footer code.

I would use 3 template files, header.php, footer.php, and body_index.php

index.php would:

1. PERFORM LOGIC
2. include header
3. include body
4. include footer

Then, all you have to do is make new body_XXX.php files for each page on
your site and the header/footer content is contained in one place.

---John Holmes...

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



Re: [PHP] Website templating schemes

2003-08-26 Thread Russell P Jones
Agreed with John W. Homes regarding his method of website templating. It
is used in that fashion for all sites run by demcampaigns.com and
www.collegedems.com

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



RE: [PHP] Website templating schemes

2003-08-26 Thread Chris W. Parker
Russell P Jones mailto:[EMAIL PROTECTED]
on Tuesday, August 26, 2003 10:44 AM said:

 Agreed with John W. Homes regarding his method of website templating.
 It is used in that fashion for all sites run by demcampaigns.com and
 www.collegedems.com

In that case it CAN'T be a good idea! HAR HAR!



Chris.

p.s. not looking to start a holy/flame war, just thought it'd be funny!

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