[TxMt] New user - PHP question

Allan Odgaard throw-away-1 at macromates.com
Fri Sep 8 14:31:54 UTC 2006

On 8/9/2006, at 15:31, Derek Belrose wrote:

> When setting the language to PHP, you get the full range of Syntax
> highlighting, code folding, etc.  When in HTML mode, you get the  
> syntax
> highlighting, but that's about it.

The only thing extra is the PHP folding patterns. Everything else  
related to PHP is available (and active) when inside a <?php … ?> tag.

I will merge the PHP folding patterns so that they are the same (when  
using HTML as language).

For a long time the PHP grammar was not supposed to be used stand- 
alone (for other than testing “raw” PHP) -- but since so many kept  
selecting it as top language, I moved matching of <?php … ?> from the  
HTML grammar to the PHP grammar, so it would work (as people  
expected), so today the only disadvantage of using PHP as top  
language is, that one will not get HTML coloring for the stuff  
outside the <?php … ?> tags.

An advantage of using PHP as top language might be that the PHP  
(source) is not scoped as being “embedded” in HTML (text), so for  
example if using the All Hallows Eve theme, one will get the normal  
source code background color (black) rather than the text background  
color (dark grey) with the “embedded” PHP in a black (very large) box.

More information about the textmate mailing list