NuSphere Forums Forum Index
NuSphere Forums
Reply to topic
HTML Beautify


Joined: 03 Mar 2004
Posts: 2
Reply with quote
Hi there, is there any HTML Beautify as for PHP, as far as i can see Tidy HTML doesn't work when we echo it ... mistake of me perhaps. It would be nice to see like select the text, right-click and beautify HTML/PHP.

Great job with 3.3!
View user's profileFind all posts by seg7Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
HTML TIDY knows nothing about php and beautifies and corrects HTML alone. If you need a 3rd party php beautifier to be integrated into PHPED, it's very easy to do. See customization TAB in the settings dialog. You may add a command that will call 3rd party program or script with the editor content and bring it back after processed.
View user's profileFind all posts by dmitriSend private messageVisit poster's website


Joined: 03 Mar 2004
Posts: 2
Reply with quote
Yes exacly i know that, i've already set PHP Beautify and it's working fine (per file) ... My point is if there's any way or program to beatify this for example:

Code:

echo '<table border="1">
      <tr>
      <td>1</td>
      <td>2></td>
      </tr>
      </table>
      ';

to

Code:

echo '<table border="1">
          <tr>
              <td>1</td>
              <td>2></td>
          </tr>
      </table>
     ';


Ident HTML, to correct as Tidy HTML...
I know this is not your responsability but if you could help me with this, probably you could indicate some 3th party program!


Last edited by seg7 on Wed Mar 03, 2004 11:25 am; edited 2 times in total
View user's profileFind all posts by seg7Send private message
Site Admin

Joined: 13 Jul 2003
Posts: 7887
Reply with quote
Html formatters like HTML Tidy has nothing to do with PHP Code...
Php formatters often take no care of string constants like your code sample contains.
You may want to re-write you code like this:

Code:
?>
<table border="1">
<tr>
<td><?=1?></td>
<td><?=2?></td>
</tr>
</table>
<?php
....

in this case HtmlTidy will take care of indenting as it is clear HTML (with some php insertions).
Maybe you better switch to Smarty ?
see http://smarty.php.net
It offers very good level of separating a presentation (html) layer from data manipulation (php) layer.
View user's profileFind all posts by dmitriSend private messageVisit poster's website
HTML Beautify
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
All times are GMT - 5 Hours  
Page 1 of 1  

  
  
 Reply to topic