mirror of https://gitee.com/karson/fastadmin.git
Formbuilder增加Slider控件
parent
af21c68626
commit
9d7970f58b
|
|
@ -367,6 +367,23 @@ class FormBuilder
|
|||
return array_merge($options, array('cols' => $segments[0], 'rows' => $segments[1]));
|
||||
}
|
||||
|
||||
/**
|
||||
* 生成滑块
|
||||
*
|
||||
* @param string $name
|
||||
* @param string $min
|
||||
* @param string $max
|
||||
* @param string $step
|
||||
* @param string $value
|
||||
* @param array $options
|
||||
* @return string
|
||||
*/
|
||||
public function slider($name, $min, $max, $step, $value = null, $options = [])
|
||||
{
|
||||
$options = array_merge($options, ['data-slider-min' => $min, 'data-slider-max' => $max, 'data-slider-step' => $step,'data-slider-value' => $value ? $value : '']);
|
||||
$options['class'] = isset($options['class']) ? $options['class'] . (stripos($options['class'], 'form-control') !== false ? '' : ' slider form-control') : 'slider form-control';
|
||||
return $this->input('text', $name, $value, $options);
|
||||
}
|
||||
/**
|
||||
* 生成下拉列表框
|
||||
*
|
||||
|
|
@ -1277,4 +1294,4 @@ if (!function_exists('array_except')) {
|
|||
return Arr::except($array, $keys);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue