2017 © Pedro Peláez
 

yii2-extension yii2-raty

Yii2 wrapper for jQuery Raty plugin

image

alfa6661/yii2-raty

Yii2 wrapper for jQuery Raty plugin

  • Wednesday, August 17, 2016
  • by alfa6661
  • Repository
  • 5 Watchers
  • 11 Stars
  • 1,544 Installations
  • JavaScript
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 0 Open issues
  • 2 Versions
  • 4 % Grown

The README.md

yii2-raty

StyleCI Total Downloads Latest Stable Version Latest Unstable Version License, (*1)

Yii2-raty is a wrapper for jQuery Raty plugin. jQuery Raty is a plugin that generates a customizable star rating automatically., (*2)

Installation

The preferred way to install this extension is through composer., (*3)

Either run, (*4)

php composer.phar require --prefer-dist alfa6661/yii2-raty "*"

or add, (*5)

"alfa6661/yii2-raty": "*"

to the require section of your composer.json file., (*6)

Usage

Once the extension is installed, simply use it in your code by :, (*7)

// Usage
= \alfa6661\widgets\Raty::widget([
    'name' => 'user-vote',
    'options' => [
        // the HTML attributes for the widget container
    ],
    'pluginOptions' => [
        // the options for the underlying jQuery Raty plugin
        // see : https://github.com/wbotelhos/raty#options
    ]
]); ?>


// Usage with model
= \alfa6661\widgets\Raty::widget([
    'model' => $model,
    'attribute' => 'rating',
    'options' => [
        // the HTML attributes for the widget container
    ],
    'pluginOptions' => [
        // the options for the underlying jQuery Raty plugin
        // see : https://github.com/wbotelhos/raty#options
    ]
]); ?>

// Usage with ActiveForm and model
= $form->field($model, 'point')->widget(\alfa6661\widgets\Raty::className(), [
    'options' => [
        // the HTML attributes for the widget container
    ],
    'pluginOptions' => [
        // the options for the underlying jQuery Raty plugin
        // see : https://github.com/wbotelhos/raty#options
    ]
]); ?>

// Javascript events handling
// Available event callbacks: Read Only, Click, Mouseover and Mouseout
= \alfa6661\widgets\Raty::widget([
    'name' => 'user-vote',
    'options' => [
        'class' => 'pull-left',
        'id' => 'user-vote'
    ],
    'pluginOptions' => [
        'click' => new \yii\web\JsExpression('function(score, e) {
            alert(score);
        }')
    ]
]); ?>

The Versions

17/08 2016

dev-master

9999999-dev

Yii2 wrapper for jQuery Raty plugin

  Sources   Download

Apache-2.0

The Requires

 

by alfa

extension yii2 star rating raty

18/08 2015

1.0

1.0.0.0

Yii2 wrapper for jQuery Raty plugin

  Sources   Download

Apache-2.0

The Requires

 

by alfa

extension yii2 star rating raty