2017-11-29 2 views
0

が不足している私は、ディレクトリのバックエンド/ウェブ/アップロード/画像を作成し、それらに777yii2 CKEditorバージョンのイメージソースのURLは、私がyii2 <a href="https://packagist.org/packages/wadeshuler/yii2-ckeditor-cdn" rel="nofollow noreferrer">https://packagist.org/packages/wadeshuler/yii2-ckeditor-cdn</a></p> <p>ため、このCKEditorバージョンの拡張機能を使用してい

を権利を与えた私は、バックエンド/設定/メインを構成しフォーム

use wadeshuler\ckeditor\widgets\CKEditor; 
<?= $form->field($model, 'body')->widget(CKEditor::className()) ?> 

に入れて、この

'modules' => [ 
     'ckeditor' => [ 
      'class' => 'wadeshuler\ckeditor\Module', // required and dont change!!! 

      'uploadDir' => '@app/web/uploads', // must be file path (required when using filebrowser*BrowseUrl below) 
      'uploadUrl' => '@web/uploads',  // must be valid URL (required when using filebrowser*BrowseUrl below) 

      // These are basically passed to the `CKEDITOR.replace()` 
      'widgetClientOptions' => [ 

       'filebrowserImageBrowseUrl' => '/ckeditor/default/image-browse', 
       'filebrowserImageUploadUrl' => '/ckeditor/default/image-upload', 
      ] 
     ], 

    ], 

よう.PHPそして、画像をアップロードして「サーバーに送信」をクリックすると、アップロードされず、「OK」をクリックすると、画像ソースURLがありません。

誰かが以前この問題に直面しているのでしょうか?私はこれらの行を削除する場合ところで 、

//'uploadDir' => '@app/web/uploads', // must be file path (required when using filebrowser*BrowseUrl below) 
     //'uploadUrl' => '@web/uploads',  // must be valid URL (required when using filebrowser*BrowseUrl below) 

何も変更されません。同じミス。

答えて

0

これはちょっと古いかもしれませんが、誰かがこの同じ問題に遭遇する可能性があることを知っていますが、私の枠組みは少し異なります。私はcodeigniterを使って、それをckeditorアップロード画像プラグインと統合しようとしていますが、戻り値がckeditorと同じであるため、アイデアを得るべきです。

hereは、私が見つけた解決策、このようになりますどのリンクを参照して、実施例3セクションに

を参照してくださいです:

// Required: anonymous function reference number as explained above. 
$funcNum = $_GET['CKEditorFuncNum'] ; 
// Optional: instance name (might be used to load a specific configuration file or anything else). 
$CKEditor = $_GET['CKEditor'] ; 
// Optional: might be used to provide localized messages. 
$langCode = $_GET['langCode'] ; 

// Check the $_FILES array and save the file. Assign the correct path to a variable ($url). 
$url = '/path/to/uploaded/file.ext'; 
// Usually you will only assign something here if the file could not be uploaded. 
$message = ''; 

echo "<script type='text/javascript'>window.parent.CKEDITOR.tools.callFunction($funcNum, '$url', '$message');</script>"; 

あなたはfilebrowserUploadUrlオプションがどのあなたのYii機能を指摘しなければならないことに注意してくださいアップロードされたイメージを処理します。この場合、上記のサンプルコードのようになります。 uploadimagefilebrowserextraPluginsオプションに追加することを忘れないでください。

希望するものがあります。

関連する問題

 関連する問題