updateAttributes()
спасла моё положение) Сделал вот так:public function actionView($id)
{
$model = $this->findModel($id);
if ($model->from_form > 2) {
$model->updateAttributes(['from_form' => $model->from_form - 2]);
}
return $this->render('view', [
'model' => $model,
]);
}
try {
var slider = document.getElementById('nonlinear');
noUiSlider.create(slider, {
start: 2000,
connect: [true, false],
range: {
'min': [500, 100],
'11%': [1000, 100],
'22%': [2000, 100],
'33%': [4000, 100],
'44%': [7000, 100],
'55%': [10000, 100],
'66%': [15000, 100],
'77%': [20000, 100],
'88%': [25000, 100],
'max': [30000, 100]
},
pips: {
mode: 'range',
density: 20
},
format: wNumb({
decimals: 0,
thousand: ','
})
});
slider.noUiSlider.on('update', function (values, handle) {
if (values[0] === "30,000") {
document.getElementById('approximately').innerHTML = values + '+';
} else {
document.getElementById('approximately').innerHTML = values;
}
document.body.querySelector('#budget').value = values;
});
} catch (e) {}
class ArtAsset extends AssetBundle
{
public $basePath = '@webroot';
public $baseUrl = '@web';
public $css = [
'css/jquery.fullpage.css',
'css/nouislider.min.css',
'css/normalize.css',
'css/style.css',
];
public $js = [
'js/jquery.fullpage.min.js',
'js/nouislider.min.js',
'js/wNumb.js',
'js/script.js',
];
public $depends = [
'yii\web\JqueryAsset',
'yii\web\YiiAsset',
];
}