E Text Editor | The Power of Textmate on Windows

 
Author Message

Index  >  Technical Support  ~  php files opening as html

thelorax
Posted: Fri Apr 13, 2007 7:28 pm Reply with quote
Registered User Joined: 29 Mar 2007 Posts: 39
Whenever I open a php file it opens as type html. This is fine in some cases but a pain in others do to some syntax highlighting rules I have created in my theme. Is there anyway to change this?
View user's profile Send private message
thelorax
Posted: Sat Apr 14, 2007 6:26 pm Reply with quote
Registered User Joined: 29 Mar 2007 Posts: 39
is there some type of config file I could edit?

anyone?
View user's profile Send private message
pnomolos
Posted: Sat Apr 14, 2007 10:35 pm Reply with quote
Registered User Joined: 22 Feb 2007 Posts: 136
Howdy,

At this time I don't believe there's anything you can edit ... I did a bunch of poking around yesterday to see what I could uncover, but nothing came up. Alexander may have it hidden somewhere but if so he did an excellent job of hiding it Smile.
View user's profile Send private message Visit poster's website
thelorax
Posted: Sun Apr 15, 2007 6:32 pm Reply with quote
Registered User Joined: 29 Mar 2007 Posts: 39
thx for the reply. maybe in the next build there will be something. this is particularly annoying because there is no shortcut to switch to php syntax so i have to to use the mouse to select php syntax whenever i open a php file.
View user's profile Send private message
Lunatic
Posted: Mon Apr 16, 2007 2:26 am Reply with quote
Registered User Joined: 16 Apr 2007 Posts: 5
It _can_ be done!

Open C:\Program Files\e\Bundles\HTML.tmbundle\Syntaxes\HTML.plist and delete line 12 (<string>php</string>).

Then open C:\Program Files\e\Bundles\PHP.tmbundle\Syntaxes\PHP.plist
and add this after line 4 (<dict>)
Code:
<key>fileTypes</key>
<array>
   <string>php</string>
</array>

Now close and re-open E and all php files should now be opened with the right bundle
View user's profile Send private message
pnomolos
Posted: Mon Apr 16, 2007 2:41 am Reply with quote
Registered User Joined: 22 Feb 2007 Posts: 136
Hi Lunatic,

Thanks for answering that one - I had been poking around in there and on the TextMate mailing lists but hadn't figured anything definitive out Smile Glad you cleared that up.
View user's profile Send private message Visit poster's website
Lunatic
Posted: Mon Apr 16, 2007 5:43 am Reply with quote
Registered User Joined: 16 Apr 2007 Posts: 5
Looks like no change was really needed. The html bundle automatically switches to the php bundle when the cursor is between <php> it just doesn't update selected bundle. It also switches to the CSS, Javascript and Smarty bundles the same way. Very cool.
View user's profile Send private message
thelorax
Posted: Wed Apr 18, 2007 3:15 am Reply with quote
Registered User Joined: 29 Mar 2007 Posts: 39
Thanks a lot lunatic. The change WAS needed as .php files were opening with the HTML bundle selected by default (even though php bundles still worked). With this fix .php files open with the PHP bundle selected by default.

This fix should really be placed in the next build of E.
View user's profile Send private message
pnomolos
Posted: Wed Apr 18, 2007 6:29 am Reply with quote
Registered User Joined: 22 Feb 2007 Posts: 136
Alexander is keeping compatibility with TextMate, which does the same thing (PHP opens under the HTML bundle, but any sections within the <?php ?> tags switch to the PHP bundle)
View user's profile Send private message Visit poster's website
bjchrist
Posted: Tue Sep 04, 2007 8:41 pm Reply with quote
Beta tester Joined: 01 Aug 2005 Posts: 277 Location: Denmark
djfoobarmatt wrote:
I guess it's html because php is an embedded language but the way I use it at work is like it's own language as most stuff happens in the includes which are all php.

See:
http://www.e-texteditor.com/forum/viewtopic.php?p=5976
View user's profile Send private message
Kryon
Posted: Mon Apr 07, 2008 1:59 pm Reply with quote
Registered User Joined: 16 Aug 2007 Posts: 14 Location: Copenhagen, DK
Hey
Just bumping this thread, as this problem returned in the lastest 1.0.15 update - I guess the HTML and/or PHP bundle got updated...
View user's profile Send private message Visit poster's website
BrandX
Posted: Thu Apr 10, 2008 2:32 am Reply with quote
Registered User Joined: 10 Apr 2008 Posts: 8
Just a confirmation, that I for some reason can't get my php files to open in php mode without manually switching them.
View user's profile Send private message
borland
Posted: Thu Apr 10, 2008 8:56 pm Reply with quote
Registered User Joined: 20 Nov 2006 Posts: 410
Ignore the fact that it says HTML at the bottom, it's supposed to.

There's no such thing as just a PHP file, they're all HTML files with <? delimiting the PHP code. Even if you have no HTML at all, php still makes you use <?, so it's fair enough for E to follow this rule.

E can and does make all the PHP stuff available once you're in a <? block
View user's profile Send private message
BrandX
Posted: Fri Apr 11, 2008 4:43 am Reply with quote
Registered User Joined: 10 Apr 2008 Posts: 8
borland wrote:
Ignore the fact that it says HTML at the bottom, it's supposed to.

There's no such thing as just a PHP file, they're all HTML files with <? delimiting the PHP code. Even if you have no HTML at all, php still makes you use <?, so it's fair enough for E to follow this rule.

E can and does make all the PHP stuff available once you're in a <? block


It wasn't when I was in the files... I had to manually click it to php.
View user's profile Send private message
borland
Posted: Sun Apr 13, 2008 9:14 pm Reply with quote
Registered User Joined: 20 Nov 2006 Posts: 410
Quote:
It wasn't when I was in the files... I had to manually click it to php.


The indicator in the status bar will still say HTML, because that's for the entire file. Ignore it.

When you're inside a <? block, all the PHP stuff will be available. for example type mysql and press ctrl+space and observe all the auto-completed PHP functions, and syntax hilighting.

If your E is *not* doing the PHP syntax hilighting, or autocompleting, *then* there is a problem, either post it in the bugs forum along with details as to how to reproduce, or log a bug in the bug tracker

Cheers.
View user's profile Send private message

Display posts from previous:  

All times are GMT
Page 1 of 2
Goto page 1, 2  Next
Post new topic

Jump to:  

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