<?xml version="1.0" encoding="UTF-8"?>
-
-<!--
-(c) Copyright IBM Corp. 2000, 2001.
-All Rights Reserved.
--->
-
<templates>
-
- <!-- php -->
-
- <template description="iterate over array" name="for" context="php"
->for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
- ${cursor}
+<template name="class" description="class template with constructor" context="php" enabled="true">class ${class_name} {
+ function ${class_name}() {
+ ${cursor}
+ }
}</template>
+<template name="class" description="class with attribute" context="php" enabled="true">class ${class_name} {
+ var $$${attribute};
+ function ${class_name}() {
+ ${cursor}
+ }
+
+ function set_${attribute}( $$${attr} ) {
+ $$this->${attribute} = $$${attr};
+ }
- <template description="iterate over array w/ temporary variable" name="for" context="php"
->for (int ${index} = 0; ${index} < ${array}.length; ${index}++) {
- ${array_type} ${array_element} = ${array}[${index}];
- ${cursor}
+ function get_${attribute}() {
+ return $$this->${attribute};
+ }
}</template>
-
- <template description="iterate over collection" name="for" context="php"
->for (Iterator ${iterator} = ${collection}.iterator(); ${iterator}.hasNext(); ) {
- ${type} ${element} = (${type}) ${iterator}.next();
+<template name="for" description="iterate over array" context="php" enabled="true">for ($$${index} = 0; $$${index} < sizeof($$${array}); $$${index}++) {
${cursor}
}</template>
-
- <template description="iterate with enumeration" name="while" context="php"
->while (${enumeration}.hasMoreElements()) {
- ${type} ${element} = (${type}) ${enumeration}.nextElement();
+<template name="for" description="iterate over array w/ temporary variable" context="php" enabled="true">for ($$${index} = 0; $$${index} < sizeof($$${array}); $$${index}++) {
+ $$${array_element} = $$${array}[$$${index}];
${cursor}
}</template>
-
- <template description="iterate with iterator" name="while" context="php"
->while (${iterator}.hasNext()) {
- ${type} ${element} = (${type}) ${iterator}.next();
+<template name="function" description="function template" context="php" enabled="true">function ${function_name} () {
${cursor}
}</template>
-
- <template description="do while statement" name="do" context="php"
->do {
+<template name="function" description="function template with return" context="php" enabled="true">function ${function_name} () {
+ return (${cursor});
+}</template>
+<template name="while" description="while iteration" context="php" enabled="true">while (${condition}) {
${cursor}
-} while (${condition});</template>
-
- <template description="switch case statement" name="switch" context="php"
->switch (${key}) {
+}</template>
+<template name="switch" description="switch case statement" context="php" enabled="true">switch (${key}) {
case ${value}:
${cursor}
break;
default:
break;
-}</template>
-
- <template description="if statement" name="if" context="php"
->if (${condition}) {
+}</template><template name="if" description="if statement" context="php" enabled="true">if (${condition}) {
${cursor}
-}</template>
-
- <template description="if else statement" name="ifelse" context="php"
->if (${condition}) {
+}</template><template name="ifelse" description="if else statement" context="php" enabled="true">if (${condition}) {
${cursor}
} else {
-}</template>
-
- <template description="else if block" name="elseif" context="php"
->else if (${condition}) {
- ${cursor}
-}</template>
-
- <template description="else block" name="else" context="php"
->else {
- ${cursor}
-}</template>
-
- <template description="try catch block" name="try" context="php"
->try {
+}</template><template name="elseif" description="else if block" context="php" enabled="true">elseif (${condition}) {
${cursor}
-} catch (${Exception} e) {
-}</template>
-
- <template description="catch block" name="catch" context="php"
->catch (${Exception} e) {
- ${cursor}
-}</template>
-
- <template description="main method" name="main" context="php"
->
-public static void main(String[] args) {
- ${cursor}
-}</template>
-
- <template description="public method" name="public_method" context="php"
->
-public ${return_type} ${name}(${arguments}) {
+}</template><template name="else" description="else block" context="php" enabled="true">else {
${cursor}
}</template>
-
- <template description="protected method" name="protected_method" context="php"
->protected ${return_type} ${name}(${arguments}) {
- ${cursor}
-}</template>
-
- <template description="private method" name="private_method" context="php"
->private ${return_type} ${name}(${arguments}) {
- ${cursor}
-}</template>
-
- <template description="private static method" name="private_static_method" context="php"
->private static ${return_type} ${name}(${arguments}) {
- ${cursor}
-}</template>
-
- <template description="dynamic type test and cast" name="instanceof" context="php"
->if (${name} instanceof ${type}) {
- ${type} ${new_name} = (${type})${name};
- ${cursor}
-}</template>
-
- <template description="dynamic cast" name="cast" context="php"
->${type} ${new_name} = (${type}) ${name};
-</template>
-
- <template description="create new object" name="new" context="php"
->${type} ${name} = new ${type}(${arguments});
-</template>
-
- <template description="lazy creation" name="lazy" context="php"
->if (${name} == null) {
- ${name} = new ${type}(${arguments});
- ${cursor}
-}
-
-return ${name};
-</template>
-
- <template description="convert collection to array" name="toarray" context="php"
- >(${type}[]) ${collection}.toArray(new ${type}[${collection}.size()]);</template>
-
- <template context="php" description="file comment used by the class and interface wizards" enabled="true" name="filecomment">/**
- * Created on ${date}
+<template name="filecomment" description="file comment used by the class and interface wizards" context="php" enabled="true">/**
+ * Created on ${date} by ${user}
*
- * To change this generated comment edit the template variable "filecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of file comments go to
- * Window>Preferences>Java>Code Generation.
- */</template>
-
-<template name="typecomment" description="type comment used by the class and interface wizards" context="php" enabled="true">/**
+ */</template><template name="functioncomment" description="function comment" context="php" enabled="true">/**
* @author ${user}
*
- * To change this generated comment edit the template variable "typecomment":
- * Window>Preferences>Java>Templates.
- * To enable and disable the creation of type comments go to
- * Window>Preferences>Java>Code Generation.
- */</template>
-
- <template description="print to standard out" name="stdout" context="php"
- >System.out.println(${cursor});</template>
-
- <template description="print to standard error" name="stderr" context="php"
- >System.err.println(${cursor});</template>
-
- <!-- html -->
-
- <template description="<code></code>" name="<code>" context="html"
- ><code>${cursor}</code></template>
-
- <template description="<code>null</code>" name="<code>" context="html"
- ><code>null</code></template>
-
- <template description="<pre></pre>" name="<pre>" context="html"
- ><pre>${cursor}</pre></template>
-
- <template description="<b></b>" name="<b>" context="html"
- ><b>${cursor}</b></template>
-
- <template description="<i></i>" name="<i>" context="html"
- ><i>${cursor}</i></template>
-
- <template description="author name" name="@author" context="html"
- >@author ${user}</template>
-
-</templates>
+ */</template>
+ <template name="echo" description="echo a string" context="php" enabled="true">echo "${string}";
+ ${cursor}</template>
+
+
+ <template name="&nbsp" description="no-break space " context="html" enabled="true">&nbsp
+ </template>
+
+ <template name="<html" description="html page with head,title,body" context="html" enabled="true">
+ <html>
+ <head>
+ <title>${title}</title>
+ </head>
+ <body>
+ ${cursor}
+ </body>
+ </html>
+ </template>
+ <template name="<title" description="title" context="html" enabled="true">
+ <title>${cursor}</title>
+ </template>
+
+ <template name="<table" description="3x3 table" context="html" enabled="true">
+ <table>
+ <tr>
+ <td>${t00}</td><td>${t01}</td><td>${t02}</td>
+ </tr>
+ <tr>
+ <td>${t10}</td><td>${t11}</td><td>${t12}</td>
+ </tr>
+ <tr>
+ <td>${t20}</td><td>${t21}</td><td>${t22}</td>
+ </tr>
+ </table>
+ ${cursor}
+ </template>
+ <template name="<table" description="3x3 table with header" context="html" enabled="true">
+ <table>
+ <tr>
+ <th>${header0}</th><th>${header1}</th><th>${header2}</th>
+ </tr>
+ <tr>
+ <td>${t00}</td><td>${t01}</td><td>${t02}</td>
+ </tr>
+ <tr>
+ <td>${t10}</td><td>${t11}</td><td>${t12}</td>
+ </tr>
+ <tr>
+ <td>${t20}</td><td>${t21}</td><td>${t22}</td>
+ </tr>
+ </table>
+ ${cursor}
+ </template>
+
+ <template name="<a" description="hyperlink (href)" context="html" enabled="true">
+ <a href="${link}">${description}</a> ${cursor}
+ </template>
+ <template name="<a" description="hyperlink image" context="html" enabled="true">
+ <a href="${link}"><img src="${image}"></a> ${cursor}
+ </template>
+ <template name="<a" description="hyperlink fragment identifier (name)" context="html" enabled="true">
+ <a name="${anchor}">${description}</a> ${cursor}
+ </template>
+ <template name="<p" description="paragraph" context="html" enabled="true">
+ <p>${cursor}</p>
+ </template>
+ <template name="<pre" description="preformated text" context="html" enabled="true">
+ <pre>${cursor}</pre>
+ </template>
+ <template name="<blockquote" description="blockquoted text" context="html" enabled="true">
+ <blockquote>${cursor}</blockquote>
+ </template>
+ </templates>
\ No newline at end of file