PHPOffice / PHPExcel

ARCHIVED
Other
11.46k stars 4.2k forks source link

use diferent path for draw diferents images #1410

Closed tekit0 closed 5 years ago

tekit0 commented 5 years ago

it is possible to use a variable, for example:

$objDrawing = new PHPExcel_Worksheet_Drawing(); $objDrawing->setName('My Image'); $objDrawing->setDescription('The Image that I am inserting'); $objDrawing->setPath('img/n/HERE_MY_VARIABLE.png'); $objDrawing->setResizeProportional(true); $objDrawing->setWidthAndHeight(50, 50); $objDrawing->setCoordinates('H4'); $objDrawing->setWorksheet($objPHPExcel->getActiveSheet());

MarkBaker commented 5 years ago

PHP string concatenation 101:

$myVariable = 'koolKatPicture';
$objDrawing->setPath('img/n/' . $myVariable . '.png');
tekit0 commented 5 years ago

Oh, I feel the stupid question, my head is saturated. Thank you mate.