meta at hooks
This commit is contained in:
parent
b7fea4122c
commit
d6d703aaa6
@ -9,7 +9,7 @@ $table = new ListJsonTable($json);
|
|||||||
$table->setBeforePrintCell(function ($key, $data) {
|
$table->setBeforePrintCell(function ($key, $data) {
|
||||||
return $key == "email" ? "<span style='color: aqua'>$data</span>" : $data;
|
return $key == "email" ? "<span style='color: aqua'>$data</span>" : $data;
|
||||||
});
|
});
|
||||||
$table->afterPrint(function () {
|
$table->afterPrint(function ($meta) {
|
||||||
return "<div>After Print</div>";
|
return "<div>After Print</div>";
|
||||||
});
|
});
|
||||||
$table->create();
|
$table->create();
|
||||||
|
@ -42,7 +42,7 @@ class ListJsonTable
|
|||||||
{
|
{
|
||||||
$paramsStr = $this->createParams($this->data['meta']['params']);
|
$paramsStr = $this->createParams($this->data['meta']['params']);
|
||||||
$hookBefore = $this->beforePrintHook;
|
$hookBefore = $this->beforePrintHook;
|
||||||
$this->html .= $hookBefore();
|
$this->html .= $hookBefore($this->data['meta']);
|
||||||
$this->html .= "<table $paramsStr>";
|
$this->html .= "<table $paramsStr>";
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -192,7 +192,7 @@ class ListJsonTable
|
|||||||
{
|
{
|
||||||
$this->html .= "</table>";
|
$this->html .= "</table>";
|
||||||
$hookAfter = $this->afterPrintHook;
|
$hookAfter = $this->afterPrintHook;
|
||||||
$this->html .= $hookAfter();
|
$this->html .= $hookAfter($this->data['meta']);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function render(): void
|
public function render(): void
|
||||||
|
Loading…
Reference in New Issue
Block a user