Closed needrunning closed 5 years ago
@needrunning 请问你使用的版本是?
@needrunning 请问你使用的版本是?
扩展是按照文档安装最新的 如何查看版本?
@needrunning
通过 git 拉取安装,还是通过 PECL ?
两个方式都用过,一样的提示。
发自我的iPhone
------------------ 原始邮件 ------------------ 发件人: viest notifications@github.com 发送时间: 2019年6月30日 15:26 收件人: viest/php-ext-excel-export php-ext-excel-export@noreply.github.com 抄送: needrunning 610212129@qq.com, Mention mention@noreply.github.com 主题: 回复:[viest/php-ext-excel-export] 设置样式报错 (#133)
@needrunning
通过 git 拉取安装,还是通过 PECL ?
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or mute the thread.
color
在 master 分支已经修改为 fontColor
文档正在修改,并于今晚发布 1.2.5
color
在 master 分支已经修改为fontColor
$format = new \Vtiful\Kernel\Format($fileHandle);
$colorStyle = $format->fontColor(\Vtiful\Kernel\Format::COLOR_ORANGE)->toResource();
这样修改后提示
Call to undefined method Vtiful\Kernel\Format::fontColor()
需要重新更新扩展吧?
@needrunning 正在发布 1.2.5
on my MAC PHP7
Build process completed successfully Installing '/usr/local/Cellar/php@7.2/7.2.18/pecl/20170718/xlswriter.so' install ok: channel://pecl.php.net/xlswriter-1.2.5 Extension xlswriter enabled in php.ini
code
public function style(array $styles) { $fileHandle = $this->handle->getHandle(); $alignStyle = \Vtiful\Kernel\Format::align( $fileHandle, \Vtiful\Kernel\Format::FORMAT_ALIGN_CENTER, \Vtiful\Kernel\Format::FORMAT_ALIGN_VERTICAL_CENTER ); foreach ($styles as $key => $width) { $this->handle->setColumn($key, (int) $width, $alignStyle); }
$format = new \Vtiful\Kernel\Format($fileHandle);
$colorStyle = $format->fontColor(\Vtiful\Kernel\Format::COLOR_ORANGE)->toResource();
}
ERROR
Non-static method Vtiful\Kernel\Format::align()
align
is not a static method, please new a format object.
$format = new \Vtiful\Kernel\Format($fileHandle);
$alignStyle = $format
->align(Format::FORMAT_ALIGN_CENTER, Format::FORMAT_ALIGN_VERTICAL_CENTER)
->toResource();
align
is not a static method, please new a format object.$format = new \Vtiful\Kernel\Format($fileHandle); $alignStyle = $format ->align(Format::FORMAT_ALIGN_CENTER, Format::FORMAT_ALIGN_VERTICAL_CENTER) ->toResource();
OK that is OK
but another error code
$this->handle->header($header)->data($data);
$fileHandle = $this->handle->getHandle();
$format = new \Vtiful\Kernel\Format($fileHandle);
$colorStyle = $format->fontColor(0xFF0000)->toResource();
$boldStyle = $format->bold()->toResource();
error
Call to undefined method Vtiful\Kernel\Format::fontColor()
I found that it is incorrect about color setting
@needrunning
php --ri xlswriter
# You can get this output
xlswriter
xlswriter support => enabled
Version => 1.2.5
bundled libxlsxwriter version => 0.7.9
Please attach your output.
插件版本 version 1.2.4
代码如下
分别报错