Пример #1
0
 /**
  * Return the form as an array, like {@link getValues()}, except for fully
  * expanded, so keys such as test[a][b] => 'blah' become expanded, nested
  * arrays, much like PHP would return from a POST of the form.
  */
 function getExpandedValues()
 {
     return SimpleForm_FormArrayHelper::expand($this->getValues());
 }
 function testExpand()
 {
     $from = array('test[a]' => 'vala', 'test[b]' => 'valb', 'test[c]' => 'valc', 'test[d][0]' => 'd0', 'test[d][1]' => 'd1');
     $this->assertEqual(SimpleForm_FormArrayHelper::expand($from), array('test' => array('a' => 'vala', 'b' => 'valb', 'c' => 'valc', 'd' => array('d0', 'd1'))));
 }