| <?xml version="1.0" encoding="UTF-8"?> |
| <!-- |
| |
| Licensed to the Apache Software Foundation (ASF) under one |
| or more contributor license agreements. See the NOTICE file |
| distributed with this work for additional information |
| regarding copyright ownership. The ASF licenses this file |
| to you under the Apache License, Version 2.0 (the |
| "License"); you may not use this file except in compliance |
| with the License. You may obtain a copy of the License at |
| |
| http://www.apache.org/licenses/LICENSE-2.0 |
| |
| Unless required by applicable law or agreed to in writing, |
| software distributed under the License is distributed on an |
| "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| KIND, either express or implied. See the License for the |
| specific language governing permissions and limitations |
| under the License. |
| |
| --> |
| |
| <!DOCTYPE codetemplates PUBLIC "-//NetBeans//DTD Editor Code Templates settings 1.0//EN" |
| "http://www.netbeans.org/dtds/EditorCodeTemplates-1_0.dtd"> |
| |
| <codetemplates> |
| |
| <!-- add alternative abbrev 'class' --> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.cls" abbreviation="cls" contexts="php-code"> |
| <code> |
| <![CDATA[class ${ClassName} { |
| function ${__construct}() { |
| ${selection}${cursor} |
| } |
| }]]> |
| </code> |
| </codetemplate> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.iface" abbreviation="iface" contexts="php-code"> |
| <code> |
| <![CDATA[interface ${InterfaceName} { |
| ${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.trt" abbreviation="trt" contexts="php-code"> |
| <code> |
| <![CDATA[trait ${TraitName} { |
| ${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.cln" abbreviation="cln" contexts="php-code"> |
| <code> |
| <![CDATA[$$${NEW_VAR newVarName default="newObj"} = clone ${VARIABLE variableFromPreviousAssignment default="$variable"}; |
| ${cursor}]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.echo" abbreviation="eco" contexts="php-code"> |
| <code> |
| <![CDATA[echo "${cursor}";]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.print" abbreviation="pr" contexts="php-code"> |
| <code> |
| <![CDATA[print ${VARIABLE variableFromPreviousAssignment default="$variable"}; |
| ${cursor}]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.print.newline" abbreviation="prln" contexts="php-code"> |
| <code> |
| <![CDATA[print ${VARIABLE variableFromPreviousAssignment default="$variable"}."\n"; |
| ${cursor}]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.print.string" abbreviation="prs" contexts="php-code"> |
| <code> |
| <![CDATA[print "${cursor}";]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.print.variable" abbreviation="prv" contexts="php-code"> |
| <code> |
| <![CDATA[print "\${VARIABLE variableFromPreviousAssignment default="$variable"} = ".${VARIABLE editable=false}."\n"; |
| ${cursor}]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.if" abbreviation="if" contexts="php-code"> |
| <code> |
| <![CDATA[if (${CONDITION variableFromPreviousAssignment instanceof="boolean" default="true"}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.else" abbreviation="els" contexts="php-code"> |
| <code> |
| <![CDATA[else { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.elif" abbreviation="elif" contexts="php-code"> |
| <code> |
| <![CDATA[elseif (${CONDITION variableFromPreviousAssignment instanceof="boolean" default="true"}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.switch" abbreviation="swi" contexts="php-code"> |
| <code> |
| <![CDATA[switch (${VARIABLE variableFromPreviousAssignment default="$variable"}) { |
| case ${$value}: |
| ${selection}${cursor} |
| break; |
| |
| default: |
| break; |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.instanceof" abbreviation="inst" contexts="php-code"> |
| <code> |
| <![CDATA[if (${VARIABLE variableFromPreviousAssignment default="$variable"} instanceof ${ClassName}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <!-- add alternative abbrev 'function' --> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.fnc" abbreviation="fnc" contexts="php-code"> |
| <code> |
| <![CDATA[function ${functionName}($$${param}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.pfnc" abbreviation="pfnc" contexts="php-code"> |
| <code> |
| <![CDATA[public function ${functionName}($$${param}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.ptfnc" abbreviation="ptfnc" contexts="php-code"> |
| <code> |
| <![CDATA[protected function ${functionName}($$${param}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.pvfnc" abbreviation="pvfnc" contexts="php-code"> |
| <code> |
| <![CDATA[private function ${functionName}($$${param}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.ifnc" abbreviation="ifnc" contexts="php-code"> |
| <code> |
| <![CDATA[public function ${functionName}($$${param});]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.fn" abbreviation="fn" contexts="php-code"> |
| <code> |
| <![CDATA[fn() => ${selection}${cursor}]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.fnp" abbreviation="fnp" contexts="php-code"> |
| <code> |
| <![CDATA[fn($$${param}) => ${selection}${cursor}]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.fnr" abbreviation="fnr" contexts="php-code"> |
| <code> |
| <![CDATA[fn(): ${type} => ${selection}${cursor}]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.fnpr" abbreviation="fnpr" contexts="php-code"> |
| <code> |
| <![CDATA[fn($$${param}): ${type} => ${selection}${cursor}]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.foreach" abbreviation="fore" contexts="php-code"> |
| <code> |
| <![CDATA[foreach (${ARRAY variableFromPreviousAssignment instanceof="array" default="$array"} as $$${value}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.foreachkey" abbreviation="forek" contexts="php-code"> |
| <code> |
| <![CDATA[foreach (${ARRAY variableFromPreviousAssignment instanceof="array" default="$array"} as $$${key} => $$${value}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.while" abbreviation="while" contexts="php-code"> |
| <code> |
| <![CDATA[while (${CONDITION variableFromPreviousAssignment instanceof="boolean" default="true"}) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.do" abbreviation="do" contexts="php-code"> |
| <code> |
| <![CDATA[do { |
| ${selection}${cursor} |
| } while (${CONDITION variableFromPreviousAssignment instanceof="boolean" default="true"});]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.itdir" abbreviation="itdir" contexts="php-code"> |
| <code> |
| <![CDATA[$$${DIRH newVarName default="dirh"} = opendir(${$dirname}); |
| if ($$${DIRH editable=false}) { |
| while (($$${DIR_ELEM newVarName default="dirElement"} = readdir($$${DIRH editable=false})) !== false) { |
| ${selection}${cursor} |
| } |
| closedir($$${DIRH editable=false}); |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.arrayIterator" abbreviation="iter" contexts="php-code"> |
| <code> |
| <![CDATA[for ($$${IDX newVarName default="index"} = 0; $$${IDX editable=false} < count(${ARRAY variableFromPreviousAssignment instanceof="array" default="$array"}); $$${IDX editable=false}++) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.mySql.fa" abbreviation="my_fa" contexts="php-code"> |
| <code> |
| <![CDATA[while ($$${NEW_VAR newVarName default="row"} = mysql_fetch_array(${$query})) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.mySql.fo" abbreviation="my_fo" contexts="php-code"> |
| <code> |
| <![CDATA[while ($$${NEW_VAR newVarName default="row"} = mysql_fetch_object(${$query})) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.mySql.fr" abbreviation="my_fr" contexts="php-code"> |
| <code> |
| <![CDATA[while ($$${NEW_VAR newVarName default="row"} = mysql_fetch_row(${$query})) { |
| ${selection}${cursor} |
| }]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.my_gc" abbreviation="my_gc" contexts="php-code"> |
| <code> |
| <![CDATA[ob_start(); |
| |
| ${selection}${cursor} |
| |
| $$${contents} = ob_get_contents(); |
| ob_end_clean();]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.pclon" abbreviation="pclon" contexts="php-code"> |
| <code><![CDATA[parent::__clone();]]></code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.pcon" abbreviation="pcon" contexts="php-code"> |
| <code> |
| <![CDATA[parent::__construct(); |
| ${cursor}]]> |
| </code> |
| </codetemplate> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.tryc" abbreviation="tryc" contexts="php-code"> |
| <code> |
| <![CDATA[try { |
| ${selection}${cursor} |
| } catch (${Exception} $$${exc}) { |
| echo $$${exc editable=false}->getTraceAsString(); |
| } |
| ]]> |
| </code> |
| </codetemplate> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.tryf" abbreviation="tryf" contexts="php-code"> |
| <code> |
| <![CDATA[try { |
| ${selection}${cursor} |
| } catch (${Exception} $$${exc}) { |
| echo $$${exc editable=false}->getTraceAsString(); |
| } finally { |
| |
| } |
| ]]> |
| </code> |
| </codetemplate> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.thr" abbreviation="thr" contexts="php-code"> |
| <code> |
| <![CDATA[throw new ${Exception};]]> |
| </code> |
| </codetemplate> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.vdoc" abbreviation="vdoc" contexts="php-code"> |
| <code> |
| <![CDATA[/** @var ${VAR_TYPE variableFromNextAssignmentType default="ClassName"} $$${VARIABLE variableFromNextAssignmentName default="variable"} */]]> |
| </code> |
| </codetemplate> |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.vdocl" abbreviation="vdocl" contexts="php-code"> |
| <code> |
| <![CDATA[/* @var $$${VARIABLE variableFromNextAssignmentName default="variable"} ${VAR_TYPE variableFromNextAssignmentType default="ClassName"} */]]> |
| </code> |
| </codetemplate> |
| |
| <codetemplate uuid="org.netbeans.modules.php.editor.codetemplate.fcom" abbreviation="fcom" contexts="php-code"> |
| <code> |
| <![CDATA[// <editor-fold defaultstate="collapsed" desc="${comment}"> |
| ${selection}${cursor}// </editor-fold> |
| ]]> |
| </code> |
| </codetemplate> |
| |
| </codetemplates> |