本文整理汇总了PHP中Formo::is_set方法的典型用法代码示例。如果您正苦于以下问题:PHP Formo::is_set方法的具体用法?PHP Formo::is_set怎么用?PHP Formo::is_set使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Formo
的用法示例。
在下文中一共展示了Formo::is_set方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: _get_val
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' => '');
}
示例2: getval
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');
}
示例3: checked
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);
}
示例4: _get_val
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');
}
示例5: _get_val
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');
}
示例6: sent
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;
}
示例7: not_empty
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;
}
示例8: not_empty
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;
}