Point well-made. I suppose doing it the mixed way might have repercussions
later on if/when the site grows. Perhaps while the code is still fresh in my
mid, it might be worth the effort to separate it.
However, for a good part of the site, I've used CSS for appearance details,
and controlling a lot of stuff that changes from page-to-page. It's very easy
to change all or some of the pages from the CSS scripts. But, for the most
part, not much of the actual php scripts COULD change, so that's why I've
never bothered to separate html from php. Perhaps I wrong, but . . .
On Sunday 02 June 2002 08:36 pm, you wrote:
> From the point of view of someone who has worked in a company where diesign
> is separated from development, it is much better to have separate files
> with HTML templates with special markers (in the library I use, it is HTML
> comments <!--element_to_replace-->) so that the two processes are
> adequately separated.
> When all of the HTML is embedded in PHP staements, minor changes to HTML
> layout involve a PHP developer, whereas with template based strategies all
> they have to do is change the template.
> I believe that 'smarty' is the "approved" template libray, but there are
> several other worth investigating.
> "Bogdan Stancescu" <[EMAIL PROTECTED]> wrote in message
> [EMAIL PROTECTED]">news:[EMAIL PROTECTED]...
> > No *real* reason - just two not-so-important ones:
> > 1. Clarity
> > Please compare these two:
> > ------ "MIXED"
> > <td bgcolor="<?php echo $td_col; ?>" class="<?php echo $prefclass; ?>">
> > <?php $fldcontent=$myrow?$myrow:"no data"; ?>
> > <input type="text" name="fname" size="50" value="<?php echo $fldcontent;
> > ?>">
> > </td>
> > ------ "PURE"
> > <?php
> > echo("<td bgcolor='$td_col' class='$prefclass'>\n");
> > $fldcontent=$myrow?$myrow:"no data";
> > echo("<input type='text' name='fname' size='50'
> > ?>
> > The second is much easier to read and understand, you must agree.
> > 2. Speed
> > There's an urban legend saying that switching php tags on and off would
> > slow parsing down. I don't know if that's true and try to write "pure"
> > php as you call it due to the first reason.
> > Bogdan
> > Andre Dubuc wrote:
> > >I've noticed that many people on the list code in 'pure' php, i.e.
> > >
> > ><?
> > >print "<input type='text' name='fname' size='50'>";
> > >
> > >// etc
> > >?>
> > >
> > >Since most of my code is a mixture (the early stuff is 'mixed' html +
> > >I've been wondering why code in 'pure' php? Is there some compelling
> > >(that I'm unaware of) for doing so? Should I rewrite all my earlier code
> > >its 'pure' form? If so, what do I do with the '<! DOCTYPE . . . >
> > >-- put it in quotes too?
> > >
> > >I would like to understand the reasons for writing code in this manner,
> > >all my code works fine, displays great: am I missing something important
> > >here? Btw, I use the 'php' ending for all file names.
> > >
> > >Your thoughts, opinions and suggestions would be greatly appreciated --
> > >like to do what is best.
> > >
> > >Tia,
> > >Andre
Please pray the Holy Rosary to end the holocaust of abortion.
Remember in your prayers the Holy Souls in Purgatory.
May God bless you abundantly in His love!
For a free Cenacle Scriptural Rosary Booklet: http://www.webhart.net/csrb/
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php