/** * Adds a radio button, building a group if necessary. * @param SimpleRadioButtonTag $tag Incoming form control. * @access private */ protected function addRadioButton($tag) { if (!isset($this->radios[$tag->getName()])) { $this->widgets[] = new SimpleRadioGroup(); $this->radios[$tag->getName()] = count($this->widgets) - 1; } $this->widgets[$this->radios[$tag->getName()]]->addWidget($tag); }
/** * Adds a radio button, building a group if necessary. * @param SimpleRadioButtonTag $tag Incoming form control. * @access private */ function _addRadioButton(&$tag) { if (!isset($this->_radios[$tag->getName()])) { $this->_widgets[] =& new SimpleRadioGroup(); $this->_radios[$tag->getName()] = count($this->_widgets) - 1; } $this->_widgets[$this->_radios[$tag->getName()]]->addWidget($tag); }
/** * Adds a radio button, building a group if necessary. * @param SimpleRadioButtonTag $tag Incoming form control. * @access private */ function _addRadioButton($tag) { if (! isset($this->_widgets[$tag->getName()])) { $this->_widgets[$tag->getName()] = &new SimpleRadioGroup(); } $this->_widgets[$tag->getName()]->addWidget($tag); }
public function testIsLabelMatchesAnyWidgetInSet() { $group = new SimpleRadioGroup(); $button1 = new SimpleRadioButtonTag(array('value' => 'A')); $button1->setLabel('one'); $group->addWidget($button1); $button2 = new SimpleRadioButtonTag(array('value' => 'B')); $button2->setLabel('two'); $group->addWidget($button2); $this->assertFalse($group->isLabel('three')); $this->assertTrue($group->isLabel('one')); $this->assertTrue($group->isLabel('two')); }