You are here

public static function PHPExcel_Calculation_LookupRef::HYPERLINK in Loft Data Grids 7.2

Same name and namespace in other branches
  1. 6.2 vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/LookupRef.php \PHPExcel_Calculation_LookupRef::HYPERLINK()

* HYPERLINK * * Excel Function: * =HYPERLINK(linkURL,displayName) * * @access public * @category Logical Functions *

Parameters

string $linkURL Value to check, is also the value returned when no error: * @param string $displayName Value to return when testValue is an error condition * @param PHPExcel_Cell $pCell The cell to set the hyperlink in * @return mixed The value of $displayName (or $linkURL if $displayName was blank)

File

vendor/phpoffice/phpexcel/Classes/PHPExcel/Calculation/LookupRef.php, line 259

Class

PHPExcel_Calculation_LookupRef
PHPExcel_Calculation_LookupRef

Code

public static function HYPERLINK($linkURL = '', $displayName = null, PHPExcel_Cell $pCell = null) {
  $args = func_get_args();
  $pCell = array_pop($args);
  $linkURL = is_null($linkURL) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($linkURL);
  $displayName = is_null($displayName) ? '' : PHPExcel_Calculation_Functions::flattenSingleValue($displayName);
  if (!is_object($pCell) || trim($linkURL) == '') {
    return PHPExcel_Calculation_Functions::REF();
  }
  if (is_object($displayName) || trim($displayName) == '') {
    $displayName = $linkURL;
  }
  $pCell
    ->getHyperlink()
    ->setUrl($linkURL);
  return $displayName;
}