Bluehost.com Web Hosting $6.95

Re: [PHP] Whats more efficient? (Conclusion)

This is a discussion on Re: [PHP] Whats more efficient? (Conclusion) within the PHP General forums, part of the PHP Programming Forums category; * Thus wrote Ryan A (ryan@coinpass.com): > Hey Curt, Hey ryan! I put this back on the list in ...


Go Back   Usenet Forums > PHP Programming Forums > PHP General

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 10-22-2003
Curt Zirzow
 
Posts: n/a
Default Re: [PHP] Whats more efficient? (Conclusion)

* Thus wrote Ryan A (ryan@coinpass.com):
> Hey Curt,


Hey ryan!

I put this back on the list in case people were ever so
curious of the system I use.

>
> /*
> In most cases a document has a top, left, content and bottom. And
> in standard conditions the top and left should be sent before the
> content is processed (which tends to take the longest to process).
> That way the page appears to load much quicker, than sitting there
> waiting for the website to respond with content while php is
> gathering all the html to send.
> */
>
> How do you do that and what engine are you using? Smarty or something
> differient?


Actually i'm not using a template engine per se. I'm looking right
now for a template engine that can do that. I havn't yet looked at
smarty but I am hoping that it has those capabilities.

What I DO do though, with my site that I have in my sig below . Is
Basically I have one controlling file called 'html' (I set apache
to run html as a php file in apache) and its logic goes something
like this:

I split the parts in the uri after the html into an array of items
so the uri:

/html/php/code/xtpl/

turns into:

$parts = array ('php', 'code', 'xtpl');

So then what 'html' does is look at the first item in the list
which happens to by 'php' in this case. It then includes a file
from a file defined file structure called php.conf.

php.conf decides a certain couple things. Like are we going to send
out html, text, authentication or just redirect someplace. It Also
sets variables like the page title and the like.

if php.conf returns successfully 'html' now goes through and
includes some common files like 'doctype.php, header.php, top.php
leftside.php' And sends those to the browser.

And when that is done, 'html' now includes the file 'php.php' (the
first php in the filename is based off of $parts[0]). This is the
muscle of the content area (in this case the php area) and does
everything inside that area. using the $parts and query_string to
determain what it needs to do.

And finally 'html' sends out the bottom.php and footer.php

/html/php
aka php.php.. uses and old method of outputing stuff. It echo's all
the content to the browser

...while..

/html/mlists
aka mlists.php.. uses a templating system to generate the html.
Which can be found in 'code' section under xtpl

Nothing on this site is really production level, It is mainly
a place I toy around with my ideas and stuff.

HTH even the slightest bit :)

Curt
--
"My PHP key is worn out"

PHP List stats since 1997:
http://zirzow.dyndns.org/html/mlists/
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT +1. The time now is 02:05 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0