You are here

private function DynamicLayout::getDeleteColumnLink in Dynamic Layouts 8

3 calls to DynamicLayout::getDeleteColumnLink()
DynamicLayout::addColumn in src/Entity/DynamicLayout.php
Add a column to a row.
DynamicLayout::addRow in src/Entity/DynamicLayout.php
Add a row to the layout.
DynamicLayout::addStartingRows in src/Entity/DynamicLayout.php
Add multiple rows to the layout.

File

src/Entity/DynamicLayout.php, line 486

Class

DynamicLayout
Defines the DynamicLayout entity.

Namespace

Drupal\dynamic_layouts\Entity

Code

private function getDeleteColumnLink($entity_id, $row_id, $column_id) {
  $delete_column_url = Url::fromRoute('dynamic_layouts.delete_column', [
    Constants::COLUMN_ID => $column_id,
    'dynamic_layout_id' => $entity_id,
    Constants::ROW_ID => $row_id,
  ]);
  $title = t('Delete column');
  $link_options = [
    'attributes' => [
      'class' => [
        'delete-link',
        'btn',
        'use-ajax',
      ],
      'title' => $title,
    ],
  ];
  $delete_column_url
    ->setOptions($link_options);
  $delete_column_link = Link::fromTextAndUrl($title, $delete_column_url);
  $delete_column = $delete_column_link
    ->toRenderable();
  return render($delete_column);
}