From 1cac815a39318afd84c7d600d61c5a07b91e5592 Mon Sep 17 00:00:00 2001
From: Edward Mann <phpeclipse.dev@edmann.com>
Date: Wed, 20 Feb 2008 19:37:47 +0000
Subject: [PATCH] new foreach in template fixes #667 submitted by pteague

---
 .../templates/default-templates.xml                |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/net.sourceforge.phpeclipse/templates/default-templates.xml b/net.sourceforge.phpeclipse/templates/default-templates.xml
index b8842d0..90c8e86 100644
--- a/net.sourceforge.phpeclipse/templates/default-templates.xml
+++ b/net.sourceforge.phpeclipse/templates/default-templates.xml
@@ -26,6 +26,15 @@
 	$$${array_element} = $$${array}[$$${index}];
 	${cursor}
 }</template>
+<template name="foreach" description="iterate over array - value" id="net.sourceforge.phpdt.php.foreach1" context="php" enabled="true">foreach ( $$${array} as $$${value} ) {
+       ${cursor}
+}</template>
+<template name="foreach" description="iterate over array - key/value" id="net.sourceforge.phpdt.php.foreach2" context="php" enabled="true">foreach ( $$${array} as $$${key} =&gt; $$${value} ) {
+       ${cursor}
+}</template>
+<template name="try-catch" description="try-catch block - default" id="net.sourceforge.phpdt.php.try1" context="php" enabled="true">try {
+       ${try}
+}</template>
 <template name="try-catch" description="try-catch block - default" id="net.sourceforge.phpdt.php.try1" context="php" enabled="true">try {
 	${try}
 }
-- 
1.7.1