示例#1
0
 public function testCanRenderBasicText()
 {
     $text = new Datepicker('birthdate');
     $expected = '<input type="text" readonly="readonly" name="birthdate">';
     $result = $text->render();
     $this->assertEquals($expected, $result);
 }
示例#2
0
 public function datepicker($name, $defaultValue = null)
 {
     $input = new Datepicker($name);
     if (!is_null($value = $this->getValueFor($name))) {
         $input->value($value);
     }
     $input->defaultValue($defaultValue);
     if ($this->hasError($name)) {
         $input->setError();
     }
     return (new InputWrapper($input))->prependIcon('calendar')->addClass('calendar date');
 }