コード例 #1
0
 public function value()
 {
     if (func_num_args() == 1) {
         $v = (int) func_get_arg(0);
         parent::value($v);
     } else {
         return parent::value();
     }
 }
コード例 #2
0
 /**
  *
  */
 public function signoff($content = true)
 {
     if ($content === true) {
         $content = date('Y-m-d');
     }
     $this->title = new HTMLAttribute($content);
     // we have no use for $this->value() in this context
     parent::value($content);
     $this->disabled = true;
 }
コード例 #3
0
 public function value()
 {
     if (func_num_args() == 1) {
         $v = func_get_arg(0);
         if ($v === '' || $v === null) {
             // these values shouldn't be typecast, they'll turn into zeroes
             $v = null;
         } else {
             // any substantial value should be cast
             $v = (int) $v;
         }
         parent::value($v);
     } else {
         return parent::value();
     }
 }
コード例 #4
0
 public function value()
 {
     if (func_num_args() == 1) {
         $v = func_get_arg(0);
         // ctype_digit will fail on timestamps in the past, so typecast here
         if (substr($v, 0, 1) == '-' && ctype_digit(substr($v, 1))) {
             $v = (int) $v;
         }
         if (is_int($v) || ctype_digit($v)) {
             $v = strftime('%m/%d/%Y', (int) $v);
         }
         // unset default field value
         if ($v == 'MM/DD/YYYY') {
             $v = '';
         }
         parent::value($v);
     } else {
         return parent::value();
     }
 }