Home Download Buy Blog Forum Support

php file showing as html

php file showing as html

Postby vishalkhialani on Wed Jul 24, 2013 4:50 pm

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
Code: Select all
<?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
Last edited by vishalkhialani on Wed Jul 24, 2013 7:45 pm, edited 1 time in total.
vishalkhialani
 
Posts: 5
Joined: Wed Nov 09, 2011 9:45 am

Re: php file showing as html

Postby vishalkhialani on Wed Jul 24, 2013 5:01 pm

by the way if I choose perl or any other syntax it works
vishalkhialani
 
Posts: 5
Joined: Wed Nov 09, 2011 9:45 am

Re: php file showing as html

Postby rob49152 on Wed Jul 24, 2013 9:26 pm

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.
rob49152
 
Posts: 14
Joined: Sat Jun 15, 2013 10:02 pm

Re: php file showing as html

Postby vishalkhialani on Wed Jul 24, 2013 9:36 pm

rob49152 wrote: 'Open all w
I did that and choose php but it does not work . it does not seem to change to php.
vishalkhialani
 
Posts: 5
Joined: Wed Nov 09, 2011 9:45 am

Re: php file showing as html

Postby rob49152 on Wed Jul 24, 2013 10:57 pm

I seem to remember reading that php uses the same styling as html and html 5
rob49152
 
Posts: 14
Joined: Sat Jun 15, 2013 10:02 pm

Re: php file showing as html

Postby Dataino on Sun Nov 03, 2013 5:47 pm

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.
Dataino
 
Posts: 1
Joined: Sun Nov 03, 2013 5:28 pm

Re: php file showing as html

Postby Lars on Fri Apr 11, 2014 3:11 am

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

Code: Select all
{
   "extensions":
   [
      "inc",
      "install",
      "module"
   ]
}
Lars
 
Posts: 1
Joined: Fri Apr 11, 2014 3:08 am


Return to Technical Support

Who is online

Users browsing this forum: No registered users and 27 guests