protected function _get_val() { $new_value = $this->_field->get('new_value'); if (Formo::is_set($new_value) === TRUE) { return $new_value; } return ($val = $this->_field->get('value')) ? $val : array('name' => '', 'type' => '', 'tmp_name' => '', 'error' => '', 'size' => ''); }
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::is_set($this->field->get('new_value')) === FALSE) { return array(); } // Otherwise return the value that's set return Formo::is_set($this->field->get('new_value'), $new_value) === TRUE ? (array) $new_value : (array) $this->field->get('value'); }
public function checked() { $parent_newval = $this->field->parent()->get('new_value'); $parent_value = $this->field->parent()->get('value'); if (Formo::is_set($parent_newval) === FALSE and !$this->field->parent(Formo::PARENT)->sent()) { return in_array($this->val(), (array) $parent_value); } return in_array($this->field->val(), (array) $parent_newval); }
protected function _get_val() { $new_value = $this->_field->get('new_value'); // If the form was sent but the field wasn't set, return FALSE if ($this->_field->sent() and Formo::is_set($new_value) === FALSE) { return FALSE; } // Otherwise return the value that's set return Formo::is_set($new_value) === TRUE ? (bool) $new_value : (bool) $this->_field->get('value'); }
protected function _get_val() { $new_value = $this->_field->get('new_value'); // If the form was sent but the field wasn't set, return empty array as value if ($this->_field->sent() AND Formo::is_set($new_value) === FALSE) return array(); // Otherwise return the value that's set return (Formo::is_set($new_value, $new_value) === TRUE) ? (array) $new_value : (array) $this->_field->get('value'); }
public function sent(array $input = NULL) { if (Formo::is_set($this->get('sent')) === TRUE) { return TRUE; } $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; }
public function not_empty() { $new_value = $this->_field->get('new_value'); if (Formo::is_set($new_value) === FALSE and !$this->_field->get('value')) { return FALSE; } return $new_value !== Formo::NOTSET; }
public function not_empty() { $new_value = $this->field->get('new_value'); if (Formo::is_set($new_value) === FALSE and !$this->field->get('value')) { return FALSE; } return (bool) $new_value; }