Sublime Forum

Php file showing as html

#1

Hi,
my file extension is not .php its .module however its essentially a php file.
I want the editor to handle it that way.

I changed it in the syntax however it keeps on showing html instead of php.

Even the sublimeLint plugin does not work.

version 2.0.2 build 2221 windows 7 64 .

sample code pls paste in your editor and check if php syntax shows up

<?php


function copy_taxonomy_menu() {
$items = array();

$items'admin/content/taxonomy/copy_question'] = array(
'title' => t('Copy Question'),
'access callback' =>'user_access',
'page callback' => 'drupal_get_form,'
'page arguments' => array('copy_taxonomy_page'),
'description' => t('Copy taxonomy from one content to another '),
'type' => MENU_NORMAL_ITEM,
);

?>

Thank you,
Vishal

0 Likes

#2

by the way if I choose perl or any other syntax it works

0 Likes

#3

In the bottom right you’ll see the current file mode that sublime is using. If you click it expands to a huge list. At the top of the list is an of-shoot menu that says ‘Open all with the current extension as…’ then select the format you want to use.

For my use of a PHP file with the .module extension I’ve found HTML5 is the best. I’ve also added in a lot of coloring additions to the scopes to make it match dreamweavers color stylings.

0 Likes

#4

I did that and choose php but it does not work . it does not seem to change to php.

0 Likes

#5

I seem to remember reading that php uses the same styling as html and html 5

0 Likes

#6

I’m having the same problem, I copy the sample code and it didn’t change but when I went to save it, it saved with the (.php) file extension.

0 Likes

#7

create or edit File Packages/User/PHP.sublime-settings with following content:

{
	"extensions":
	
		"inc",
		"install",
		"module"
	]
}
0 Likes