Re: Functions vs html outpuit

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

 



On Fri, 01 Sep 2006 16:44:19 +0200, M. Sokolewicz wrote:

> Dave Goodchild wrote:
>> Hi all, this may seem like a silly question, but I am creating a library of
>> html form element generation function, for example a textarea fucntion that
>> takes rows and cols as parameters, a function that generates a day, month
>> and year select box, etc. My question is - is it significantly to switch 
>> off
>> the parser and emit raw html than calling a function? If it is faster to
>> just allow the server to send the html I will not bother.
>> 
> 
> I'm not quite sure I understand your question. Are you asking if it's 
> faster to parse and process a php script vs. a page of raw HTML?
> 
> In that case, OF COURSE SERVING A RAW HTML FILE IS FASTER!!!
> Does the server have to do *anything* with the contents of the HMTL file? no
> Does the server have to do *anything* with the contents of the PHP file? 
> yes! of course! it needs to parse and process it BEFORE it can actually 
> server the RESULT of that script.
> 
> So, if possible, stick to raw HTML files.
> - tul

That said, if you feel that it saves you a lot of development time (like
me) to use such functions, and you're writing a basic app that will not
likely attract lots of hits, then go for it.

I use a viewForm() function, that takes an array as a argument describing
the required form, for all of my projects. Surely it's faster for the
server if you just write the HTML, but this is much easier for me to
create, edit and re-use in other projects...

Just my 2 cts.

Ivo

-- 
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