File tree Expand file tree Collapse file tree 1 file changed +7
-8
lines changed
Expand file tree Collapse file tree 1 file changed +7
-8
lines changed Original file line number Diff line number Diff line change @@ -37,17 +37,17 @@ class IonSlider extends InputWidget
3737 /**
3838 * Render range slider
3939 *
40- * @return string|void
40+ * @return string
4141 */
4242 public function run ()
4343 {
44+ $ this ->registerAssets ();
45+
4446 if ($ this ->hasModel ()) {
45- echo Html::activeTextInput ($ this ->model , $ this ->attribute , $ this ->options );
46- } else {
47- echo Html::textInput ($ this ->name , $ this ->value , $ this ->options );
47+ return Html::activeTextInput ($ this ->model , $ this ->attribute , $ this ->options );
4848 }
4949
50- $ this ->registerAssets ( );
50+ return Html:: textInput ( $ this ->name , $ this -> value , $ this -> options );
5151 }
5252
5353 /**
@@ -57,16 +57,15 @@ protected function registerAssets()
5757 {
5858 $ view = $ this ->getView ();
5959 IonSliderAsset::register ($ view );
60- $ js = '$("# ' . $ this ->options ['id ' ] . '").ionRangeSlider( ' . $ this ->getPluginOptions () . '); ' ;
61- $ view ->registerJs ($ js , $ view ::POS_END );
60+ $ view ->registerJs ('$("# ' . $ this ->options ['id ' ] . '").ionRangeSlider( ' . $ this ->getPluginOptions () . '); ' );
6261 }
6362
6463 /**
6564 * Return plugin options in json format
6665 *
6766 * @return string
6867 */
69- public function getPluginOptions ()
68+ protected function getPluginOptions ()
7069 {
7170 $ this ->pluginOptions ['type ' ] = ArrayHelper::getValue ($ this ->pluginOptions , 'type ' , $ this ->type );
7271
You can’t perform that action at this time.
0 commit comments