简体   繁体   English

如何在yii2中通过composer安装扩展程序/小部件

[英]How to install extension/widget via composer in yii2

I newbie in yii2. 我是yii2的新手。 i try to install extention Ckeditor. 我尝试安装扩展Ckeditor。 Scenario : 场景:

  1. I used xampp. 我用过xampp。
  2. my folder name in htdocs is 'bic' 我在htdocs中的文件夹名称是'bic'

=== install via composer ================= ===通过作曲家安装=================

c:\xampp\php>composer require 2amigos/yii2-ckeditor-widget

successfully to install, but i can't still used. 成功安装,但我仍然无法使用。 and in my 在我的

bic\\yiisoft\\vendor i can't find 2amigos folder. bic \\ yiisoft \\ vendor我找不到2amigos文件夹。

i write in my view 我认为

use dosamigos\ckeditor\CKEditor;
<?= $form->field($model, 'text')->widget(CKEditor::className(), [
`options` => [`rows` => 6],
`preset` => `basic`
]) ?>

I've got error Class dosamigos\\ckeditor\\CKEditor not found. dosamigos\\ckeditor\\CKEditordosamigos\\ckeditor\\CKEditor错误。

So, i think, i was wrong to install extensions via composer. 因此,我认为通过Composer安装扩展程序是错误的。 Please give me advice. 请给我建议。

Have you check your composer.json file to include something like?: 您是否检查过composer.json文件以包含类似内容?:

"require": {
    ...
  "2amigos/yii2-ckeditor-widget" : "2.0",
    ...
}

Anyway you are using backticks instead of single quotes in options and missing one in 'preset' => 'basic ... Is it a typo? 无论如何,您在选项中使用反引号而不是单引号,并且在'preset' => 'basic遗漏了一个...是错字吗?

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

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