public function toInput() { if ($this->value == $this->getValue()) { $this->set("checked"); } return parent::toInput(); }
public function toInput() { if ($this->getValue() && $this->value == $this->getValue()) { $this->set("checked"); } // Also respect array value (for multiple checkboxes with same name) if (is_array($this->value) && in_array($this->getValue(), $this->value)) { $this->set("checked"); } return parent::toInput(); }
/** * @covers Control::toInput */ public function testToInput() { $actual = $this->control->toInput(); $excepted = '<DateChoice ></DateChoice>'; $this->assertEquals($excepted, $actual); }
public function toInput() { if ($this->showPopup) { $script = $this->getCalInitScript(); $this->getForm()->setCalendarShown(); return parent::toInput() . $script; } if ($this->showTime) { $return = $this->getHourDropdown(); if ($this->showMinute) { $return .= ":" . $this->getMinuteDropdown(); } else { $return .= $this->getMinuteDropdown(true); } $return .= " " . $this->getPMDropdown(); $return .= $this->getHiddenField(); } else { $return = parent::toInput() . $this->getDateFormatLabel(); } return $return; }