尝试安装yii2-date-picker-widget时出错

时间:2016-03-10 16:13:44

标签: yii2 composer-php yii2-advanced-app yii2-widget

我是yii2框架的新手。当我尝试安装小部件时,收到错误消息。我的命令在这里:

sudo作曲家需要2 amigos/yii2-date-picker-widget:~1.0

错误就在这里:

您的要求无法解析为可安装的软件包。

问题1

- 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].

问题2

For ORA-01466 : Unable to read data -- Table definition has changed
cause - the query was executed with a snapshot older than the time the object was changed.

潜在原因:   - 包名中的拼写错误   - 根据您的最小稳定性设置,包装没有足够稳定的版本    有关详细信息,请参阅https://getcomposer.org/doc/04-schema.md#minimum-stability

阅读https://getcomposer.org/doc/articles/troubleshooting.md了解更多常见问题。

有人可以帮助我吗?感谢每一个答案!

2 个答案:

答案 0 :(得分:3)

您是否尝试过发布:

composer global require "fxp/composer-asset-plugin:~1.1.1"

答案 1 :(得分:0)

步骤-1     在Project主文件夹的Terminal上运行此命令     ----> curl -s http://getcomposer.org/installer | PHP

步骤-2     运行此命令后成功安装     ---> php composer.phar需要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...

步骤-3     在views->中定义此库_form.php这个     使用kartik \ date \ DatePicker;

步骤-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
    ]
]);?>