%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.149 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /proc/11585/cwd/html/ppaobm/vendor/yiisoft/yii2-jui/ |
Upload File : |
<?php /** * @link http://www.yiiframework.com/ * @copyright Copyright (c) 2008 Yii Software LLC * @license http://www.yiiframework.com/license/ */ namespace yii\jui; use yii\helpers\Html; /** * SliderInput renders a slider jQuery UI widget that writes its value into hidden input. * * For example, * * ``` * echo SliderInput::widget([ * 'model' => $model, * 'attribute' => 'amount', * 'clientOptions' => [ * 'min' => 1, * 'max' => 10, * ], * ]); * ``` * * The following example will use the name property instead: * * ``` * echo SliderInput::widget([ * 'name' => 'amount', * 'clientOptions' => [ * 'min' => 1, * 'max' => 10, * ], * ]); * ``` * * You can also use this widget in an [[yii\widgets\ActiveForm|ActiveForm]] using the [[yii\widgets\ActiveField::widget()|widget()]] * method, for example like this: * * ```php * <?= $form->field($model, 'from_date')->widget(\yii\jui\SliderInput::classname(), [ * 'clientOptions' => [ * 'min' => 1, * 'max' => 10, * ], * ]) ?> * ``` * * @see http://api.jqueryui.com/slider/ * @author Alexander Makarov <sam@rmcreative.ru> * @since 2.0 */ class SliderInput extends InputWidget { /** * @var array the HTML attributes for the container tag. * @see \yii\helpers\Html::renderTagAttributes() for details on how attributes are being rendered. */ public $containerOptions = []; /** * @inheritDoc */ protected $clientEventMap = [ 'change' => 'slidechange', 'create' => 'slidecreate', 'slide' => 'slide', 'start' => 'slidestart', 'stop' => 'slidestop', ]; /** * @inheritdoc */ public function init() { parent::init(); if (!isset($this->containerOptions['id'])) { $this->containerOptions['id'] = $this->options['id'] . '-container'; } } /** * Executes the widget. */ public function run() { echo Html::tag('div', '', $this->containerOptions); if ($this->hasModel()) { echo Html::activeHiddenInput($this->model, $this->attribute, $this->options); $this->clientOptions['value'] = Html::getAttributeValue($this->model, $this->attribute); } else { echo Html::hiddenInput($this->name, $this->value, $this->options); $this->clientOptions['value'] = $this->value; } if (!isset($this->clientEvents['slide'])) { $this->clientEvents['slide'] = 'function (event, ui) { jQuery("#' . $this->options['id'] . '").val(ui.value); }'; } $this->registerWidget('slider', $this->containerOptions['id']); } }