Example #1
0
 public function getval()
 {
     // If the form was sent but the field wasn't set, return empty array as value
     if ($this->field->sent() and Formo::notset($this->field->get('new_value'))) {
         return FALSE;
     }
     // Otherwise return the value that's set
     return !Formo::notset($this->field->get('new_value')) ? (bool) $this->field->get('new_value') : (bool) $this->field->get('value');
 }
Example #2
0
 public function sent(array $input = NULL)
 {
     if (!Formo::notset($this->get('sent'), $sent)) {
         return $sent;
     }
     $input = $input !== NULL ? $input : $this->get('input');
     foreach ((array) $input as $alias => $value) {
         if ($this->find($alias) !== TRUE) {
             $this->set('sent', TRUE);
             return TRUE;
         }
     }
     return FALSE;
 }
Example #3
0
 public function not_empty()
 {
     $new_value = $this->field->get('new_value');
     if (Formo::notset($new_value) and !$this->field->get('value')) {
         return FALSE;
     }
     return (bool) $new_value;
 }