See Release Notes
Long Term Support Release
Differences Between: [Versions 400 and 401]
1 <?php 2 3 namespace PhpOffice\PhpSpreadsheet\Calculation\LookupRef; 4 5 use PhpOffice\PhpSpreadsheet\Calculation\Functions; 6 use PhpOffice\PhpSpreadsheet\Calculation\Information\ExcelError; 7 use PhpOffice\PhpSpreadsheet\Cell\Cell; 8 9 class Hyperlink 10 { 11 /** 12 * HYPERLINK. 13 * 14 * Excel Function: 15 * =HYPERLINK(linkURL, [displayName]) 16 * 17 * @param mixed $linkURL Expect string. Value to check, is also the value returned when no error 18 * @param mixed $displayName Expect string. Value to return when testValue is an error condition 19 * @param Cell $cell The cell to set the hyperlink in 20 * 21 * @return mixed The value of $displayName (or $linkURL if $displayName was blank) 22 */ 23 public static function set($linkURL = '', $displayName = null, ?Cell $cell = null) 24 { 25 $linkURL = ($linkURL === null) ? '' : Functions::flattenSingleValue($linkURL); 26 $displayName = ($displayName === null) ? '' : Functions::flattenSingleValue($displayName); 27 28 if ((!is_object($cell)) || (trim($linkURL) == '')) { 29 return ExcelError::REF(); 30 } 31 32 if ((is_object($displayName)) || trim($displayName) == '') { 33 $displayName = $linkURL; 34 } 35 36 $cell->getHyperlink()->setUrl($linkURL); 37 $cell->getHyperlink()->setTooltip($displayName); 38 39 return $displayName; 40 } 41 }
title
Description
Body
title
Description
Body
title
Description
Body
title
Body