dqnqpqv3841 2019-02-18 10:02
浏览 62

ckeditor在创建帖子时工作正常但在编辑帖子时丢失

In the app.blade.php file I have added:

<script src="../vendor/unisharp/laravel-ckeditor/ckeditor.js"></script>
<script>
        CKEDITOR.replace( 'article-ckeditor' );
</script>

And then in the create.blade.php file:

{{Form::textarea('body','',['id'=>'article-ckeditor',
                            'class'=>'form-control',
                            'placeholder'=>'Body Text'])
}}

In the edit.blade.php file:

{{Form::textarea('body', $post->body,['id'=> 'article-ckeditor',
                                      'class'=>'form-control',
                                      'placeholder'=>'Body Text'])
}}

CKeditor shows on create a page but missing on the edit page.

My question is, what else I must write down in the Laravel, that the CKeditor will be visible on edit page?

  • 写回答

1条回答 默认 最新

  • dotif64826 2019-06-11 17:59
    关注

    Had the same problem, just in case you still have the issue, check out:

    https://artisansweb.net/install-use-ckeditor-laravel/

    Also make sure the script with string interpolation {{asset}} in app.blade.php points to the correct path. Mine had to jump out of the folder to vendor (../vendor). Yours could be different.

    Note that the next script has CKEDITOR.replace( 'summary-ckeditor' ); and not CKEDITOR.replace( article-ckeditor' ); Most important ensure your id in both edit.blade.php and create.blade.php points to summary-ckeditor and not article-ckeditor.

    评论

报告相同问题?

悬赏问题

  • ¥15 基于卷积神经网络的声纹识别
  • ¥15 Python中的request,如何使用ssr节点,通过代理requests网页。本人在泰国,需要用大陆ip才能玩网页游戏,合法合规。
  • ¥100 为什么这个恒流源电路不能恒流?
  • ¥15 有偿求跨组件数据流路径图
  • ¥15 写一个方法checkPerson,入参实体类Person,出参布尔值
  • ¥15 我想咨询一下路面纹理三维点云数据处理的一些问题,上传的坐标文件里是怎么对无序点进行编号的,以及xy坐标在处理的时候是进行整体模型分片处理的吗
  • ¥15 CSAPPattacklab
  • ¥15 一直显示正在等待HID—ISP
  • ¥15 Python turtle 画图
  • ¥15 stm32开发clion时遇到的编译问题