pluf2

pluf2 Commit Details


Date:2008-11-30 03:31:51 (16 years 22 days ago)
Author:Loic d'Anterroches
Branch:master
Commit:3fb39807c9713cfd926592223c37d19b76c43f5d
Parents: 4a4fe11a64c80380998fb8f81ac9ab6117cb211c
Message:Added array access to the form.

Changes:

File differences

src/Pluf/Form.php
3030
3131
3232
33
33
3434
3535
3636
......
369369
370370
371371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
372394
373395
374396
* The form handling is heavily inspired by the Django form handling.
*
*/
class Pluf_Form implements Iterator
class Pluf_Form implements Iterator, ArrayAccess
{
/**
* The fields of the form.
return (false !== current($this->fields));
}
public function offsetUnset($index)
{
unset($this->fields[$index]);
}
public function offsetSet($index, $value)
{
$this->fields[$index] = $value;
}
public function offsetGet($index)
{
if (!isset($this->fields[$index])) {
throw new Exception('Undefined index: '.$index);
}
return $this->fields[$index];
}
public function offsetExists($index)
{
return (isset($this->fields[$index]));
}
}

Archive Download the corresponding diff file

Branches

Number of commits:
Page rendered in 0.05825s using 13 queries.