NotePad++ 安装Zen coding 完美支持PHP
依据Html或css增加自动补全,发现 PHP的美元符转义为数字1,或2或3
配置路径为: \Notepad++\plugins\NppScripting\includes\Zen Coding.js
在var zen_settings中增加 'phpSymbol': '$', 在调用时 ${phpSymbol} 即可自动补全 带有美元函数, 如 $name;
'variables': { 'lang': 'en', 'locale': 'en-US', 'charset': 'UTF-8', 'profile': 'xhtml', 'phpSymbol': '$', /** Inner element indentation */ 'indentation': '\t' // TODO take from Aptana settings }
'html:5': '<?php ?>'+ '<!DOCTYPE HTML>\n' + '<html lang="${locale}">\n' + '<head>\n' + ' <meta charset="${charset}">\n' + ' <title></title>\n' + '</head>\n' + '<body>\n\t${child}|\n</body>\n' + '</html>', 'foreach':'foreach(${phpSymbol}data as ${phpSymbol}key => ${phpSymbol}val){\n' + ' array[${phpSymbol}key] = ${phpSymbol}val;\n' + '\n\t${child}|\n' + '}', 'fun' : 'function funName(${phpSymbol}param1 = "", ${phpSymbol}param2 = ""){\n' + '\n\t${child}|\n' + ' ${phpSymbol}result = ture;\n' + ' return ${phpSymbol}result;\n' + '}', 'for' : 'for(${phpSymbol}i = 0; ${phpSymbol}i < count(${phpSymbol}data); ${phpSymbol}i++){\n' + '\n\t${child}|\n' + '}'
输入foreach 或 fun 或 for 时: 按Ctrl +E 将自动补全
foreach($data as $key => $val){ array[$key] = $val; //光标 } for($i = 0; $i < count($data); $i++){ //光标 } function funName($param1 = "", $param2 = ""){ //光标 $result = ture; return $result; }
标签:val,++,coding,Zen,phpSymbol,result,data,foreach From: https://www.cnblogs.com/zhouein/p/18561184