CJuiSliderInput displays a slide. it also encapsulates the JUIslider plug-in and can be used in Form as the UI component for user input. Basic usage: [php] & lt; divclass & quot; form & quot; & gt; & lt ;? Php $ form $ this-& gt; beginWidget (& amp; #39; CActiv CJuiSliderInput shows a slide, which also encapsulates the JUI slider plugin, it can be used in Form as the UI component for user input. Basic usage: [php] BeginWidget ('cactiveform');?> ErrorSummary ($ model);?> Widget ('zii. widgets. jui. CJuiSliderInput ', array ('model' => $ model, 'attribute' => 'size', 'name' => 'My _ slider', 'value' => 50, 'event' => 'change', 'options' => array ('min' => 0, 'Max '=> 100, 'slide' => 'JS: function (event, ui) {$ ("# amount "). text (ui. value);} ',), 'htmloptions' => array ('style' => 'width: 200px; float: left; '),);?> 50 EndWidget ();?> BeginWidget ('cactiveform');?> ErrorSummary ($ model);?> Widget ('zii. widgets. jui. CJuiSliderInput ', array ('model' => $ model, 'attribute' => 'size', 'name' => 'My _ slider', 'value' => 50, 'event' => 'change', 'options' => array ('min' => 0, 'Max '=> 100, 'slide' => 'JS: function (event, ui) {$ ("# amount "). text (ui. value);} ',), 'htmloptions' => array ('style' => 'width: 200px; float: left; '),);?> 50 EndWidget ();?> After the user submits the request, use result. php to display user input values. DataModel is defined as follows: [php] class DataModel extends CFormModel {public $ size; public function rules () {return array ('size ', 'Safe '),) ;}} class DataModel extends CFormModel {public $ size; public function rules () {return array ('size ', 'Safe '),) ;}} modify the indexAction method of SiteController: [php] public function actionIndex () {$ model = new DataModel (); $ model-> size = 50; if (! Emptyempty ($ _ POST ['datamodel ']) {$ model-> attributes = $ _ POST ['datamodel']; if ($ model-> validate ()) {$ this-> render ('result', array ('model' => $ model,); return ;}$ this-> render ('index ', array ('model' => $ model,);} public function actionIndex () {$ model = new DataModel (); $ model-> size = 50; if (! Empty ($ _ POST ['datamodel ']) {$ model-> attributes = $ _ POST ['datamodel']; if ($ model-> validate ()) {$ this-> render ('result', array ('model' => $ model,); return ;}$ this-> render ('index ', array ('model' => $ model ,));}
-