Skip to main content
Inspiring
January 22, 2017
Answered

Apply source formatting doesn't work in php file

  • January 22, 2017
  • 3 replies
  • 1748 views

I have an html file with the file extension *.php. It is 95% straight html 5, with a few lines of php. If I choose Edit | Code | Apply Source Formatting, nothing happens. I can understand that DW might not format the php code (i.e., the code within "<?php" and "?>", but it also doesn't format any of the html (e.g., div's, p's, etc). Is this by design? I'm using DW 2017.0.1.


Thanks!

This topic has been closed for replies.
Correct answer SteveIsHere

I now see this post: Re: (Dreamweaver 2017.0.1) problems with apply source formatting​.

It looks like it is a bug.

3 replies

Legend
December 31, 2018

Have you tried using CC 2019 ?

Paul-M - Community Expert
BROnstott
Known Participant
December 31, 2018

I’m using it.

SteveIsHereAuthorCorrect answer
Inspiring
January 22, 2017

I now see this post: Re: (Dreamweaver 2017.0.1) problems with apply source formatting​.

It looks like it is a bug.

Nancy OShea
Community Expert
Community Expert
January 22, 2017

Make it known to the development team.  The more requests they get to fix it, the higher its priority.

Bugs with fewer requests get lower priority.

Nancy

Nancy O'Shea— Product User & Community Expert
BROnstott
Known Participant
December 30, 2018

I have a site where all the file extensions are .php.  When I use Tools/format source code, DW does nothing. I'm using DW CC, 11193 build. 

Is there some setting that can be changed to make this work?  It used to work fine, was disabled when I went to CC.  If it's not a setting, it must be a bug, but I've submitted a bug report which elicited no response.

Help?

Nancy OShea
Community Expert
Community Expert
January 22, 2017

Did you define formatting in your Tag Libraries first?

You might also want to validate code for errors.

Nancy O'Shea— Product User & Community Expert
Inspiring
January 22, 2017

Nancy, I'm unsure what you are asking. If I choose Edit Tag Libraries, the default HTML and PHP tags are defined. I'm not trying to change how it formats the source (i.e., define special formatting). I just want it to format the source (using the default HTML/PHP tag definitions). For example, line up opening and closing div tags.

If I take the same source file and save it with the htm extension, it the Apply Source Formatting does work.


The code does validate.

Thanks.