How To Insert A Spinner In A View ?

I try to insert a Spinner in a Yii 2.0 view with yii/jui/Spinner, downloaded from Github.

In the view I’ve inserted the following command :

[i]use yii\jui\Spinner;

echo Spinner::widget(array(

'name'  => 'country',

'clientOptions' => array(

	'step' => 2,




but I’ve got the error message: Cannot redeclare class yii\jui\DatePicker.

Can someone give me an advice?

Can you please give the full error message with file and line of code + stack trace?

The full message error is:

Compile Error – yii\base\ErrorException

Cannot redeclare class yii\jui\DatePicker

  1. in /Applications/MAMP/htdocs/yii2/advanced/vendor/yiisoft/yii2/yii/jui/datepicker.php at line 99

94 $contents[] = Html::tag(‘div’, null, $this->options);

95 }


97 return implode("\n", $contents);

98 }

99 }

  1. yii\base\Application::handleFatalError()

How did a file named "datepicker.php" come to the the jui directory there? The file in lower case name is not part of the yii code…

Also the directory structure does not look like you are using the latest code. Please upated at least to the alpha version of yii2 and try again.

Thank you for spending time for my question.

It’s true “DatePicker.php” is not part of the yii code.

I installed the alpha version of yii2 and I didn’t find how insert a Spinner in a view.

From GitHub, I installed the development made by Alexander Kochetov: a jQuery UI spinner widget (


Perhaps, it’s not a good idea.

But how insert a spinner widget with the pure alpha version of yii2?

I solved my problem.

JUI extension was improperly installed.

Proper installation procedure is describe here: