public function __invoke(FieldInterface $field) { $field->addHelperFilter('TableCell.Content', function ($content, TableCell $helper, array $rowData, $rowIndex, $columnIndex) { if (!$content) { return null; } if (!$this->urlTemplate || !isset($rowData[$this->id]) || !$rowData[$this->id]) { return $content; } else { $node = new Node('a'); $node->setHtml($content)->setAttribute('href', sprintf($this->urlTemplate, $rowData[$this->id]))->setAttribute('class', implode(' ', $this->cssClasses)); if ($this->title) { $node->setAttribute('title', $this->title); } if ($this->target) { $node->setAttribute('target', $this->target); } return $node; } }); }