|
Posted by Curtis on 01/02/06 22:49
J.O. Aho <user@example.net> wrote in message
news:41t3tcF1gctppU1@individual.net...
> Curtis wrote:
>
> > <?php
> > global $user;
> > if ($user->uid) {?> <li><a href="logout" title="">Log
> > Out</a></li>
> > <?php } else {?> <li><a href="user/login" title="">Log
> > In</a></li>
> > <?php }?>
> >
> > Ten characters in order to type that closing brace? Wow.
>
> This generates less work for PHP than what
>
> <?PHP
> if ($user->uid) {
> echo "<li><a href=\"logout\" title=\"\">Log
Out</a></li>";
> } else {
> echo "<li><a href=\"login\" title=\"\">Log In</a></li>";
> }
> ?>
That was all I could think of, J.O.
I'm not sure the tradeoff is anywhere near worth it, though.
Better more work for PHP, I'd think, that be driven crazy as
a code maintainer trying to read the mixed PHP-MTML soup.
I suspect that on most sites the speed improvement, if any,
would be marginal. I can't speak from much experience, but
in the project I'm working on--a text filter--the text
processing done by PHP scanning text twenty-plus times and
substituting this for that would probably dwarf the output
of a little HTML as PHP strings.
--
Curtis
Visit We the Thinking
www.wethethinking.com
An online magazine/forum
devoted to philosophical
thought.
>
>
> file://Aho
[Back to original message]
|