i want to access LINE_DOUBLE from the Border Library of phppresentation using string "LINE_DOUBLE" have tried using constant() but no luck any other solution will be very helpful
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"]);
}
There are two ways
constant()
function$border
is an object not class and to access the Class constant, you need Class instead of it's objectReflection
Let me know, if either of them works or not