I was just pondering about how I could easily make my source code look nice. I have always found it very annoying to go through and correctly indent my PHP echos and other server-side generated code.
Anybody know any tricks?
This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.
The active forums are here.
August 19, 2008 3:39pm
Subscribe [2]#1 / Aug 19, 2008 3:39pm
I was just pondering about how I could easily make my source code look nice. I have always found it very annoying to go through and correctly indent my PHP echos and other server-side generated code.
Anybody know any tricks?
#2 / Aug 19, 2008 3:57pm
If it’s that important to you, you could run the final output from the output class through HTML Tidy filters:
Randy
#3 / Aug 20, 2008 6:01am
vim!
[esc]gg=G
job done!
#4 / Aug 20, 2008 10:23am
Hey Sleeper - I think your keyboard is stuck (or you only have three keys ‘v’ ‘i’ & ‘m’) hehehe—jk
Unless I’m way off base, Fenix was attempting to format code generated by a PHP script not within a text editor.
PHP echos and other server-side generated code
A post processing shell script would be necessary to do this with VIM. It would be kind if you posted the full c/bash/born/etc. shebang script that would be called with the auto_append_file PHP directive.
Randy