2016-07-30 18 views
1

でCKEditorバージョンを使用して、私は正常にインストールされますが、チュートリアル(https://symfony.com/doc/current/bundles/IvoryCKEditorBundle/index.html)で説明したように、私は私の形で私たちにそれをしようとするとエラーが表示されます。私はsymfony3にCKEditorバージョンを使用しようsymfony3

$builder->add('content', CKEditorType::class); 

それは生産このエラーは:

Type error: Argument 1 passed to Ivory\CKEditorBundle\Form\Type\CKEditorType::__construct() must be an instance of Ivory\CKEditorBundle\Model\ConfigManagerInterface, none given

それは私が間違っている、にformTypeはそのコンストラクタでのparamsを要求するべきではないため、問題がある、のように見えますか?

+0

これはIvoryCKEditorBundleのバグのようです。 – felipsmartins

+0

@felipsmartinsそうではありません。 – mblaettermann

答えて

1

私は同じエラーを持っていたAppKernelにCKEditorBundleを追加することによってそれを解決しました。 これはCountZero'sのコメントの答えに記載されています。 IvoryCKEditorBundleインストールノートhereを見つけることができます。

class AppKernel extends Kernel 
{ 
    public function registerBundles() 
    { 
     $bundles = array(
      new Ivory\CKEditorBundle\IvoryCKEditorBundle(), 
      // ... 
     ); 

     // ... 
    } 
} 
1

IvoryCKEditorBundleにバグはありません。あなたがcomposer.jsonを提供した場合、コマンドbin/console debug:containerbin/console config IvoryCKEditorBundleの結果は、より正確な答えを与えるのに役立ちます。

it looks like, there is a problem because a FormType should not demand params in its constructor, am I wrong?

あなたは間違っていますが、CKEditorTypeはそのコンストラクタでparamsを要求することがあり、現在のバージョンではそうしています。 ファイルに問題がありますvendor/egeloen/ckeditor-bundle/Resources/config/form.xml CKEditorBundleのサービス依存関係を設定(提供)する必要がありますが、そうではありません。

私が作曲、明確なキャッシュとこのバンドルのデバッグサービスコンテナの設定を更新しようと、それは次のようになります。

⇒ composer update 
⇒ bin/console cache:clear 
⇒ bin/console debug:container|grep ivory  
    ivory_ck_editor.config_manager          Ivory\CKEditorBundle\Model\ConfigManager              
    ivory_ck_editor.form.type           Ivory\CKEditorBundle\Form\Type\CKEditorType             
    ivory_ck_editor.plugin_manager          Ivory\CKEditorBundle\Model\PluginManager              
    ivory_ck_editor.renderer            Ivory\CKEditorBundle\Renderer\CKEditorRenderer            
    ivory_ck_editor.styles_set_manager         Ivory\CKEditorBundle\Model\StylesSetManager             
    ivory_ck_editor.template_manager          Ivory\CKEditorBundle\Model\TemplateManager             
    ivory_ck_editor.twig_extension          Ivory\CKEditorBundle\Twig\CKEditorExtension 
+2

ええ、私にとってOPはCKEditorBundleを 'AppKernel'に含めるのを忘れてしまったようです。 – mblaettermann

+0

@mblaettermannあなたは正しいです!私はもう一度チェックしたが、私はそれを忘れずに、別のプロジェクトでappkernelを変更した。どうも。 Btw、私はこの文章が好きです: "IvoryCKEditorBundleにバグはありません。" :) – Asara

+0

もしあなたの誰かがこれを答えて(appkernelをチェックするために)解決策としてマークします – Asara

関連する問題