You are here

public function ExternalLinkPopupController::enable in External Link Pop-up 8

Enables a ExternalLinkPopup object.

Parameters

\Drupal\external_link_popup\Entity\ExternalLinkPopup $external_link_popup: The ExternalLinkPopup object to enable.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse A redirect response to the ExternalLinkPopup listing page.

1 string reference to 'ExternalLinkPopupController::enable'
external_link_popup.routing.yml in ./external_link_popup.routing.yml
external_link_popup.routing.yml

File

src/Controller/ExternalLinkPopupController.php, line 23

Class

ExternalLinkPopupController
Route controller class for the external_link_popup module.

Namespace

Drupal\external_link_popup\Controller

Code

public function enable(ExternalLinkPopup $external_link_popup) {
  $external_link_popup
    ->enable()
    ->save();
  return new RedirectResponse($external_link_popup
    ->toUrl('collection', [
    'absolute' => TRUE,
  ])
    ->toString());
}