php - 如何从数据库中检索数据并能够在summernote编辑器中进行编辑?

标签 php html database laravel summernote

我遇到了一个问题,但找不到解决方案。 我的问题是我应用了一个名为(Wysiwyg-summernote 编辑器到我的 Laravel 框架项目中)的插件。一切正常,但是当我单击编辑页面时,数据无法从数据库中检索并直接使用编辑器功能进行编辑。有熟悉这方面的人可以帮我吗?非常感谢

As you can see my placeholder is the value retrieve from the database, i just wondering why i couldn't put the data into the editor function and directly edit from it

<div class="form-group">


 <label for="company_policy_policy_details">Please Enter Policy Details<span<p><font color="#F05340"> *</font></p></label></span>

                <input type="text" name="policy_details" id="abc"  class="form-control" value="{!!$policy->policy_details!!}" cols="139" rows="10">
                </textarea>
            </div>



            <div id="summernote"></div>

            <script>

                $('#abc').summernote({
                    placeholder:value="{!!$policy->policy_details!!}",
                    tabsize: 2,
                    height: 100
                });
            </script>
            </body>
            </html>
            </div>`

预期输出 = 我希望占位符中的值能够在编辑器中显示并能够直接编辑,谢谢sssss

After update , but not the expected output i want

最佳答案

我相信这段代码将显示来自您数据库的数据。

$('#summernote').summernote({
    placeholder: "{!!$policy->policy_details!!}",
    tabsize: 2,
    height: 100
}).summernote('code', `{!!$policy->policy_details!!}`);

关于php - 如何从数据库中检索数据并能够在summernote编辑器中进行编辑?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/60219205/

相关文章:

php - 使用友好的 url 更改 .htaccess 时无法获取变量

php - 如何在 MySQL 中存储 bool 数据类型?

php - 检测更新中找到的行

php - 标题创建的数据库中的双链接

javascript - 在控制台中显示附加值

html - 推拉标签来组织不同的复杂布局

html - 为什么 vuetify 数据表会拉伸(stretch)整个页面而不是渲染滚动条?

php - 如何在 PHP 中使用数组从数据库列中选择 url

php - “PDOException”消息“SQLSTATE[22001] : String data, 右截断:0

php - 如何将保存在服务器文件夹中的图像与 mySQL 数据库中的数据一起显示?