How to pass php variable to PluginEvent config Slider Kartik extension for Yii2

161 viewsphpyii2php yii2
0

I use Slider Kartik extension for Yii2. There is PluginEvent options, that i want to config to my needs. So here is my code:

<?php echo Slider::widget([
    'name'=>'rating_1',
    'value'=>7,
    'sliderColor'=>Slider::TYPE_GREY,
    'pluginEvents' => [
        'slide' => "function(slideEvt) { 
            $('#testVal. ').text(slideEvt.value); 
        }",
    ],
]);
?>
<span>Current Slider Value: <span id="testVal">3</span></span>

But in my HTML layout i used models attribute like: $value['strategy_title']
Is there is the way to put my $value['strategy_title'] instead of #testVal?
enter image description here