Giter Site home page Giter Site logo

yii2-ion-slider's Introduction

RangeSlider Extension for Yii 2


Widget based on Ion.RangeSlider extension

Latest Stable Version Total Downloads License Build Status

Installation

The preferred way to install this extension is through composer.

Either run

php composer.phar require --prefer-dist yii2mod/yii2-ion-slider "*"

or add

"yii2mod/yii2-ion-slider": "*"

to the require section of your composer.json.

Usage

Once the extension is installed, simply add widget to your page as follows:

  1. Usage with ActiveForm and model
echo $form->field($model, "attribute")->widget(\yii2mod\slider\IonSlider::className(), [
        'pluginOptions' => [
           'min' => 0,
           'max' => 1,
           'step' => 1,
           'onChange' => new \yii\web\JsExpression('
                function(data) {
                     console.log(data);
                }
           ')
         ]
]); 
  1. Usage without ActiveForm and model
echo \yii2mod\slider\IonSlider::widget([
    'name' => 'slider',
    'type' => \yii2mod\slider\IonSlider::TYPE_DOUBLE,
    'pluginOptions' => [
        'min' => 0,
        'max' => 20,
        'from' => 2,
        'to' => 18,
        'step' => 1,
        'hide_min_max' => true,
        'hide_from_to' => true
    ]
]);
                                

To change the slider skin, you can configure the assetManager array in your application configuration:

'assetManager' => [
            'bundles' => [
                'yii2mod\slider\IonSliderAsset' => [
                    'css' => [
                        'css/normalize.css',
                        'css/ion.rangeSlider.css',
                        'css/ion.rangeSlider.skinFlat.css'
                     ]
                ],
            ],
        ]

Slider Options

You can customize the slider using pluginOptions, using one of the plugin options. Note that the type option should be configured on its own, and is not part of the pluginOptions array.

yii2-ion-slider's People

Contributors

dmitry-semenov avatar krakozaber avatar machour avatar mcserep avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

yii2-ion-slider's Issues

Put back "type" in the $pluginOptions property

Hi,

I think that the "type" options should go back inside the $pluginOptions, as it is confusing for developers.

BC could be maintained by checking if type was provided as a direct property and using it, but if provided $pluginOptions['type'] should be considered valid.

Unable to find 'app\assets\AppAsset'

Ошибка при попытке IonSliderAsset::register($view);

Unknown Class – yii\base\UnknownClassException

Unable to find 'app\assets\AppAsset' in file: /home/bitrix/www/frontend/assets/AppAsset.php. Namespace missing?

Возможно, нужно убрать зависимость app\assets\AppAsset...

css files not available

Unable to resolve the request "assets/a8873b00/css/ion.rangeSlider.skinHTML5.css".
Unable to resolve the request "assets/a8873b00/css/normalize.css".

...does not exist: ...vendor/bower/ion.rangeSlider

Hi!

After some updates I got The file or directory to be published does not exist: /<projectDir>/vendor/bower/ion.rangeSlider

I just updated my project to latest fxp/etc (I don't sure what concrete made the fail) and the directory named in lower case (ion.rangeslider).

For now I just created a symlink(ion.rangeslider => ion.rangeSlider) to solve the problem. But may be there is a more correct way to fix it? May be here ?

thnx

change the slider skin is not working

I configure my assetmanager bundles, but asset manager load wrong css:
css/ion.rangeSlider.skinNice.css

For experiment i delete all css and js from IonSliderAsset, but scripts and styles STILL LOADING!

Check, please!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.