0

私は yii2 フレームワークが初めてです。ウィジェットをインストールしようとすると、エラー メッセージが表示されます。私のコマンドはここにあります:

sudo composer require 2amigos/yii2-date-picker-widget:~1.0

エラーは次のとおりです。

お客様の要件は、インストール可能な一連のパッケージに解決できませんでした。

問題1

- The requested package bower-asset/bootstrap-datepicker could not be found in any version, there may be a typo in the package name.

問題 2

- 2amigos/yii2-date-picker-widget 1.0.x-dev requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.5 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.4 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.3 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.2 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.1 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- 2amigos/yii2-date-picker-widget 1.0.0 requires bower-asset/bootstrap-datepicker 1.4.0 -> no matching package found.

- Installation request for 2amigos/yii2-date-picker-widget ~1.0 -> satisfiable by 2amigos/yii2-date-picker-widget[1.0.0, 1.0.1, 1.0.2, 1.0.3, 1.0.4, 1.0.5, 1.0.x-dev].

考えられる原因: - パッケージ名のタイプミス - 最小安定度の設定によると、十分な安定度を備えたバージョンでパッケージを利用できません詳細。

その他の一般的な問題については、https://getcomposer.org/doc/articles/troubleshooting.mdを参照してください。

誰でも私を助けることができますか?すべての答えに感謝します!

4

2 に答える 2

3

起動しようとしましたか:

composer global require "fxp/composer-asset-plugin:~1.1.1"
于 2016-03-10T16:42:32.357 に答える
0

STEP -1 プロジェクトのメイン フォルダにあるターミナルでこのコマンドを実行します。---->curl -s http://getcomposer.org/installer | php

STEP -2 このコマンドでインストール成功 --->php composer.phar require kartik-v/yii2-widget-datepicker "*"

you can see this contant in advanced->composer.json
 "kartik-v/yii2-widget-datepicker": "*"
If you can't see this, means you missing some...

STEP -3 ビューでこのライブラリを定義 -> _form.php use kartik\date\DatePicker;

STEP -4 そして最後に、フォームの日付フィールドで以下のコードを定義します

<?= $form->field($model, 'xyz_field')->widget(DatePicker::ClassName(),
    [
    'name' => 'check_issue_date', 
   // 'value' => date('d-M-Y', strtotime('+2 days')),
    'options' => ['placeholder' => 'Select issue date ...'],
    'pluginOptions' => [
        'format' => 'yyyy/dd/mm',
        'todayHighlight' => true
    ]
]);?>
于 2016-06-23T10:20:37.310 に答える