Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/php/254.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
关于羽毛笔js、羽毛笔图像大小和PHP羽毛笔渲染器的问题_Php_Quill - Fatal编程技术网

关于羽毛笔js、羽毛笔图像大小和PHP羽毛笔渲染器的问题

关于羽毛笔js、羽毛笔图像大小和PHP羽毛笔渲染器的问题,php,quill,Php,Quill,我已经在我的网站上实现了。有了这个,我还想要一个图像大小调整器,很多人都推荐。我还安装了将Quill的Delta翻译成HTML的程序 我测试了所有内容,它工作正常(我从渲染器接收的数据与我随表单发布的数据相对应) 但是,如果在羽毛笔编辑器中调整图像大小并将其发送到渲染器,则会出现以下错误: Fatal error: Uncaught TypeError: Argument 1 passed to DBlackborough\Quill\Delta\Html\Insert::__construct

我已经在我的网站上实现了。有了这个,我还想要一个图像大小调整器,很多人都推荐。我还安装了将Quill的Delta翻译成HTML的程序

我测试了所有内容,它工作正常(我从渲染器接收的数据与我随表单发布的数据相对应)

但是,如果在羽毛笔编辑器中调整图像大小并将其发送到渲染器,则会出现以下错误:

Fatal error: Uncaught TypeError: Argument 1 passed to DBlackborough\Quill\Delta\Html\Insert::__construct() must be of the type string, array given, called in ...... on line 22
我检查了文件,该函数位于第22行:

public function __construct(string $insert, array $attributes = [])
{
    $this->tag = null;

    $this->insert = $insert;
    $this->attributes = $attributes;
}
作为所有这些的初学者,我不知道我应该做什么。我假设因为我使用的是一个外部组件(即,Quill图像大小调整器),它不是Quill js的一部分,因此Php Quill渲染器的开发人员没有添加对图像大小调整的支持


有谁能指导我纠正这个错误的步骤吗?

我也有同样的问题,下面是我如何纠正它的

有关问题的信息:

调整图像大小时,
Quill Image Resizer
插件插入属性
width=“xx”
。但是,在
PHP Quill Renderer
中,Parse不知道该属性,与no Delta关联使用默认值

switch ($attribute) {
    default:
        $this->insert($quill);
        break;
}
解决方案:

为了纠正这个问题,我们需要在选项中添加一个新的
width
常量,然后在parse中,我们需要添加一个新的
case
以将该常量链接到图像

页面:Options.php(ligne:50)

页面:Parser/Parse.php(ligne:179)

不确定这是否是最好的解决方案,但它解决了问题,并且不需要对基本功能进行任何更改。正如您在我的代码中所看到的,我还添加了
alt
属性以将其与图像相关联。这可能对你同样有利


祝你好运

我看到这一点有点晚了,但如果这仍然是一个问题,在回购协议上产生问题,我会解决它。或者,提出一个公关,我会合并到你的修复。
public const ATTRIBUTE_WIDTH = 'width';
public const ATTRIBUTE_ALT = 'alt';
case Options::ATTRIBUTE_WIDTH:
    $this->image($quill);
    break;
case Options::ATTRIBUTE_ALT:
    $this->image($quill);
    break;