Re: PHP support question (2)

In <3BE52A23.63C024C8@gmx.net>, Rolf Hemmerling <hemmerling@gmx.net> writes:

> a) Where may I find "phptidy" ?

I am not aware of any PHP beautifier, although there is a good chance someone 
has written one. phptidy was given as an example of an "external" beautifier.
Depending on your PHP style, the C pretty printer cb may work.

> My problem is the re-coding of the PHP braces ">" and "<" into "&gt;"
> and "&lt;"
> <?php echo $URL ?>
> into "&gt;" and "&lt;"
> ,
> when used as part of a URL.

> So how might I code right for Tidy, so that the URL contains the URL of
> the "current document in which this code is found", by the help of PHP
> or SSI/SHTML, WITHOUT Javascript/Java ?
>
> Or is this a "bug" or "missing feature" ?

Since tags and PIs are not valid in attributes, tidy's behavious is correct
(not from a PHP programmer's perspective, of course).

A tidy compatible way that will also survive other editing tools is to change

> <?php $URL ="http://".$HTTP_HOST.$SCRIPT_NAME ?>
> <A href=
> "http://www.tranexp.com:2000/InterTran?type=url&amp;from=eng&amp;to=pob&amp;url=<?php
> echo $URL ?>">translate<A>

to

<?php
  $URL = "http://".$HTTP_HOST.$SCRIPT_NAME;
  echo "<a href=\"http://www.tranexp.com:2000/InterTran?type=url&amp;from=eng&amp;to=pob&amp;url=$URL\">translate<a>";
?>

-- 
Klaus Johannes Rusch
KlausRusch@atmedia.net
http://www.atmedia.net/KlausRusch/

Received on Sunday, 4 November 2001 07:43:05 UTC