我想使用字符串“LINE_DOUBLE”从 phppresentation 的边界库访问 LINE_DOUBLE 已尝试使用常量()但没有运气任何其他解决方案将非常有帮助
use PhpOffice\PhpPresentation\PhpPresentation;
use PhpOffice\PhpPresentation\Style\Alignment;
use PhpOffice\PhpPresentation\Style\Bullet;
use PhpOffice\PhpPresentation\Style\Color;
use PhpOffice\PhpPresentation\IOFactory;
use PhpOffice\PhpPresentation\Style\Border;
use PhpOffice\PhpPresentation\Style\Fill;
public function addLine($val)
{
$border = new Border;
$str = "LINE_DOUBLE";
$lineShape = $this->currentSlide->createLineShape($val["startX"],$val["startY"],$val["endX"],$val["endY"]);
$lineShape->getBorder()
->setLineStyle(constant("$border::$str"))
->setLineWidth($val["width"])
->getColor()->setARGB($val["lineColor"]);
}