简体   繁体   English

yii2 小部件未通过 Composer 安装

[英]yii2 widgets are not installing via composer

Can't able to install widget using composer for yii2 framework无法使用 yii2 框架的 composer 安装小部件

My composer look like this:我的作曲家看起来像这样:

"require": {
    "php": ">=5.4.0",
    "yiisoft/yii2": "~2.0.6",
    "yiisoft/yii2-bootstrap": "~2.0.0",
    "yiisoft/yii2-swiftmailer": "~2.0.0 || ~2.1.0"

},
"require-dev": {
    "yiisoft/yii2-debug": "~2.0.0",
    "yiisoft/yii2-gii": "~2.0.0",
    "yiisoft/yii2-faker": "~2.0.0",
    "codeception/base": "^2.2.3",
    "codeception/verify": "~0.3.1"
},

You need to change your constraint in the composer.json to the following您需要将composer.json中的约束更改为以下内容

"require": {
    "php": ">=5.4.0",
    "yiisoft/yii2": "~2.0.6",
    "yiisoft/yii2-bootstrap": "~2.0.0",
    "yiisoft/yii2-swiftmailer": "~2.0.0"
},
"require-dev": {
    "yiisoft/yii2-debug": "~2.0.0",
    "yiisoft/yii2-gii": "~2.0.0",
    "yiisoft/yii2-faker": "~2.0.0",
    "codeception/base": "^2.2.3",
    "codeception/verify": "~0.3.1"
},

As according to the DOCS根据DOCS

Note: Version 2.1 of this extensions uses Swiftmailer 6 , which requires PHP 7 .注意:此扩展的Version 2.1使用Swiftmailer 6 ,它需要PHP 7 If you are using PHP 5 , you have to use version 2.0 of this extension, which uses Swiftmailer 5 , which is compatible with PHP 5.4 and higher.如果您使用的是PHP 5 ,则必须使用此扩展的version 2.0 ,它使用与PHP 5.4及更高版本兼容的Swiftmailer 5

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM