mirror of
https://github.com/espocrm/espocrm.git
synced 2026-06-29 15:36:07 +00:00
type fixes
This commit is contained in:
@@ -47,9 +47,13 @@ class TableTag implements Helper
|
||||
$attributesPart .= " width=\"{$width}\"";
|
||||
}
|
||||
|
||||
$function = $data->getFunction();
|
||||
|
||||
$content = $function !== null ? $function() : '';
|
||||
|
||||
return Result::createSafeString(
|
||||
"<table border=\"{$border}\" cellpadding=\"{$cellpadding}\" {$attributesPart}>" .
|
||||
$data->getFunction()() .
|
||||
$content .
|
||||
"</table>"
|
||||
);
|
||||
}
|
||||
|
||||
@@ -51,10 +51,12 @@ class TdTag implements Helper
|
||||
$attributesPart .= " width=\"{$width}\"";
|
||||
}
|
||||
|
||||
$function = $data->getFunction();
|
||||
|
||||
$content = $function !== null ? $function() : '';
|
||||
|
||||
return Result::createSafeString(
|
||||
"<td>" .
|
||||
$data->getFunction()() .
|
||||
"</td>"
|
||||
"<td>" . $content . "</td>"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,10 +37,12 @@ class TrTag implements Helper
|
||||
{
|
||||
public function render(Data $data): Result
|
||||
{
|
||||
$function = $data->getFunction();
|
||||
|
||||
$content = $function !== null ? $function() : '';
|
||||
|
||||
return Result::createSafeString(
|
||||
"<tr>" .
|
||||
$data->getFunction()() .
|
||||
"</tr>"
|
||||
"<tr>" . $content . "</tr>"
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,6 +30,7 @@
|
||||
namespace Espo\Core\Htmlizer\Helper;
|
||||
|
||||
use stdClass;
|
||||
use Closure;
|
||||
|
||||
class Data
|
||||
{
|
||||
@@ -55,12 +56,12 @@ class Data
|
||||
private $rootContext;
|
||||
|
||||
/**
|
||||
* @var ?callable
|
||||
* @var ?Closure
|
||||
*/
|
||||
private $func = null;
|
||||
|
||||
/**
|
||||
* @var ?callable
|
||||
* @var ?Closure
|
||||
*/
|
||||
private $inverseFunc = null;
|
||||
|
||||
@@ -77,8 +78,8 @@ class Data
|
||||
array $context,
|
||||
array $rootContext,
|
||||
int $blockParams,
|
||||
?callable $func,
|
||||
?callable $inverseFunc
|
||||
?Closure $func,
|
||||
?Closure $inverseFunc
|
||||
) {
|
||||
$this->name = $name;
|
||||
$this->argumentList = $argumentList;
|
||||
@@ -137,12 +138,12 @@ class Data
|
||||
return $this->options->$name ?? null;
|
||||
}
|
||||
|
||||
public function getFunction(): ?callable
|
||||
public function getFunction(): ?Closure
|
||||
{
|
||||
return $this->func;
|
||||
}
|
||||
|
||||
public function getInverseFunction(): ?callable
|
||||
public function getInverseFunction(): ?Closure
|
||||
{
|
||||
return $this->inverseFunc;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user