Adds a div overlay with a spinning loader on submit
Current version 1.1.0, (*1)
The preferred way to install this extension is through composer., (*2)
Either run, (*3)
php composer.phar require --prefer-source "c006/yii2-submit-spinner" "dev-master"
, (*4)
or add, (*5)
"c006/yii2-submit-spinner": "dev-master"
, (*6)
to the require section of your composer.json
file., (*7)
jQuery, (*8)
yii \ widgets \ ActiveForm, (*9)
class_id => {string}
The ID of the container. default: "SubmitSpinner"
, (*10)
form_id => {string}
The ID of the form
, (*11)
bg_color => {string}
Color of the overlay
, (*12)
bg_opacity => {float}
Opacity of the overlay
, (*13)
spin_speed => {int}
How many seconds a for a complete 360 rotation
, (*14)
radius => {int}
Pixel radius/width of the spinner
, (*15)
bg_spinner_opacity => {float}
Opacity of main spinner
, (*16)
bg_spinner_color => {string}
Color of main spinner
, (*17)
sections => {int}
How many dots or circles
, (*18)
section_size => {int}
Dot/circle size in px
, (*19)
section_color => {string}
Color of dots/circles
, (*20)
section_offset => {int}
How far from the center in px
, (*21)
section_opacity_base => {float}
Minimum opacity e.g. 0.25
, (*22)
proportionate_increase => {boolean}
Will increase/decrease dots proportionally to the main spinner
, (*23)
form_validate => {boolean}
Will trigger on successful ActiveForm validation
, (*24)
Demo: http://demo.c006.us, (*25)
Added javascript functions, (*26)
show_submit_spinner(), (*27)
hide_submit_spinner(), (*28)
Once the extension is installed, simply use it in your code by :, (*29)
Defaults option:, (*30)
> = \c006\spinner\SubmitSpinner::widget(); ?>, (*31)
All options: (using defaults), (*32)
> = c006\spinner\SubmitSpinner::widget( [ 'form_id' => $form->id, 'bg_color' => '#444444', 'bg_opacity' => 0.8, 'spin_speed' => 4, 'radius' => 200, 'bg_spinner_opacity' => 0.5, 'bg_spinner_color' => '#000000', 'sections' => 15, 'section_size' => 20, 'section_color' => '#FFFFFF', 'section_offset' => 80, 'section_opacity_base' => .2, 'proportionate_increase' => 1, ] ) ?>, (*33)
All options: (5 large dots only, no background spinner), (*34)
> = c006\spinner\SubmitSpinner::widget( [ 'form_id' => $form->id, 'bg_color' => '#333333', 'bg_opacity' => 0.8, 'spin_speed' => 4, 'radius' => 250, 'bg_spinner_opacity' => 0.0, 'bg_spinner_color' => '#000000', 'sections' => 5, 'section_size' => 80, 'section_color' => '#FFFFFF', 'section_offset' => 80, 'section_opacity_base' => .2, 'proportionate_increase' => 0, ] ) ?>, (*35)
Please provide any helpful feedback or requests., (*36)
Thanks., (*37)