Re: Embedding HTML Within a PHP Statement [message #176000 is a reply to message #175987] |
Mon, 14 November 2011 18:52 |
Denis McMahon
Messages: 634 Registered: September 2010
Karma:
|
Senior Member |
|
|
On Mon, 14 Nov 2011 12:30:17 +0000, Tim Streater wrote:
> In article <4ec0f420$0$6915$e4fe514c(at)news2(dot)news(dot)xs4all(dot)nl>,
> Erwin Moller
> <Since_humans_read_this_I_am_spammed_too_much(at)spamyourself(dot)com> wrote:
>
>> I don't think that approach is very recommendable. At least not as a
>> general recipe.
>
> It won't cover many situations, I agree.
>
>> A few drawbacks:
>> - Your full ajax approach results in multiple requests to the server
>> (where one request would suffice without AJAX.).
>
> I would rather eat three correctly-sized meals a day than one very big
> meal once a week.
Hmm
I tend to try and do all the processing, and then the output, usually
with a heredoc for the latter.
Any dynamically generated content is tucked into variables during the
processing section, so that all that happens during "output" is variable
substitution in the heredoc with {$phpVarName}.
I figure this is probably less resource intensive on the server than
pausing during output to do processing.
I guess this is the "one big meal" approach, but I seem to think that it
might mean that io resources are used more efficiently.
Rgds
Denis McMahon
|
|
|