Re: Re: Functions vs html outpuit
| From: | Dave Goodchild | Date: | Sun, 03 Sep 2006 12:22:38 +0000 |
| Subject: | Re: Re: Functions vs html outpuit | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-241338@lists.php.net to get a copy of this message | ||
Thanks, that was what I needed to hear. Cheers.
On 03/09/06, Ivo F.A.C. Fokkema <I.F.A.C.Fokkema@lumc.nl> wrote:
On Fri, 01 Sep 2006 16:44:19 +0200, M. Sokolewicz wrote: Dave Goodchild wrote:-- http://www.web-buddha.co.uk http://www.projectkarma.co.uklibrary ofHi all, this may seem like a silly question, but I am creating athathtml form element generation function, for example a textarea fucntionmonthtakes rows and cols as parameters, a function that generates a day,switchand year select box, etc. My question is - is it significantly totooff the parser and emit raw html than calling a function? If it is fasterI'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.phpjust allow the server to send the html I will not bother.