Changeset 24217
- Timestamp:
- 11/22/09 07:47:54 (4 years ago)
- Files:
-
- branches/1.3/lib/test/sfTesterForm.class.php (modified) (2 diffs)
- branches/1.4/lib/test/sfTesterForm.class.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
branches/1.3/lib/test/sfTesterForm.class.php
r21908 r24217 132 132 else 133 133 { 134 $error = $this-> form[$field]->getError();134 $error = $this->getFormField($field)->getError(); 135 135 } 136 136 … … 227 227 return $parameters; 228 228 } 229 230 /** 231 * @param string $path 232 * @return sfFormField 233 */ 234 235 public function getFormField($path) 236 { 237 if (false !== $pos = strpos($path, '[')) 238 { 239 $field = $this->form[substr($path, 0, $pos)]; 240 } 241 else 242 { 243 return $this->form[$path]; 244 } 245 246 if (preg_match_all('/\[(?P<part>[^]]+)\]/', $path, $matches)) 247 { 248 foreach($matches['part'] as $part) 249 { 250 $field = $field[$part]; 251 } 252 } 253 254 return $field; 255 } 229 256 } branches/1.4/lib/test/sfTesterForm.class.php
r21908 r24217 132 132 else 133 133 { 134 $error = $this-> form[$field]->getError();134 $error = $this->getFormField($field)->getError(); 135 135 } 136 136 … … 227 227 return $parameters; 228 228 } 229 230 /** 231 * @param string $path 232 * @return sfFormField 233 */ 234 235 public function getFormField($path) 236 { 237 if (false !== $pos = strpos($path, '[')) 238 { 239 $field = $this->form[substr($path, 0, $pos)]; 240 } 241 else 242 { 243 return $this->form[$path]; 244 } 245 246 if (preg_match_all('/\[(?P<part>[^]]+)\]/', $path, $matches)) 247 { 248 foreach($matches['part'] as $part) 249 { 250 $field = $field[$part]; 251 } 252 } 253 254 return $field; 255 } 229 256 }