ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Keeping server-side source code neat

August 19, 2008 3:39pm

Subscribe [2]
  • #1 / Aug 19, 2008 3:39pm

    Fenix

    66 posts

    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

    Randy Casburn

    997 posts

    If it’s that important to you, you could run the final output from the output class through HTML Tidy filters:

    http://tidy.sourceforge.net

    Randy

  • #3 / Aug 20, 2008 6:01am

    vim!

    [esc]gg=G

    job done!

  • #4 / Aug 20, 2008 10:23am

    Randy Casburn

    997 posts

    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

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases