You are here

public function DynamicLayout::getRowLink in Dynamic Layouts 8

Render a link to add a column to a row.

Parameters

int $row_id: The specific row id.

string $route: The route we need to render the link to.

string $text: The text we want to render in the link.

array $options: Give options to the link.

Return value

string The rendered link.

File

src/Entity/DynamicLayout.php, line 564

Class

DynamicLayout
Defines the DynamicLayout entity.

Namespace

Drupal\dynamic_layouts\Entity

Code

public function getRowLink($row_id, $route, $text, array $options = []) {
  $link = Link::createFromRoute($text, $route, [
    'dynamic_layout_id' => $this
      ->id(),
    Constants::ROW_ID => $row_id,
  ], $options);
  $renderLink = $link
    ->toRenderable();
  return render($renderLink);
}