Exemplo n.º 1
0
 public function toInput()
 {
     if ($this->value == $this->getValue()) {
         $this->set("checked");
     }
     return parent::toInput();
 }
Exemplo n.º 2
0
 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();
 }
Exemplo n.º 3
0
 /**
  * @covers Control::toInput
  */
 public function testToInput()
 {
     $actual = $this->control->toInput();
     $excepted = '<DateChoice ></DateChoice>';
     $this->assertEquals($excepted, $actual);
 }
Exemplo n.º 4
0
 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;
 }