Php 如何为Sublimiter 3创建新的语法定义?
我在Sublime Text 3(GNU/Linux with KDE Desktop下)中使用了以下过梁:Php 如何为Sublimiter 3创建新的语法定义?,php,sublimetext3,sublimelinter,Php,Sublimetext3,Sublimelinter,我在Sublime Text 3(GNU/Linux with KDE Desktop下)中使用了以下过梁:csslint、htmlidy、jshint和phplint。除了在某些情况下,它们都工作得很好 例如,我有一个名为style.PHP的PHP文件,首先从WordPress设置API获取一些选项,然后关闭PHP代码并启动样式的HTML标记:。。。在style标记中,我有更多的PHP代码,这是Linter不起作用的代码 <?php // PHP linter works $op
csslint
、htmlidy
、jshint
和phplint
。除了在某些情况下,它们都工作得很好
例如,我有一个名为style.PHP
的PHP文件,首先从WordPress设置API获取一些选项,然后关闭PHP代码并启动样式的HTML标记:
。。。在style
标记中,我有更多的PHP代码,这是Linter不起作用的代码
<?php // PHP linter works
$option1 = get_option( 'option_1' ); // 'phplint' works
$option2 = get_option( 'option_2' ); // 'phplint' works
$option3 = get_option( 'option_3' ); // 'phplint' works
?>
<style type="text/css"><!-- 'htmltidy' is not working -->
<?php // 'phplint' doesn't work here
$body = 'body{';
$pattern = get_option( 'option_1' );
if ( ! empty( $option1[ 'background-color' ] ) ) {
$body .= 'background-color:' . $option1[ 'background-color' ] . ';';
}
$body .= '}';
echo $body . "\n";
?>
/* 'csslint' works perfect here */
.select1 {
color: <?php echo $option2; ?>; /* 'phplint' doesn't work*/
}
.select2 {
color: <?php echo $option3; ?>; /* 'phplint' doesn't work*/
}
"syntax_map": {
"html (django)": "html",
"html (rails)": "html",
"html 5": "html",
"javascript (babel)": "javascript",
"magicpython": "python",
"php": "html",
"python django": "python"
},