You are here

public function FlexsliderOptionsetController::disable in Flex Slider 8.2

Disables an Flexslider object.

Parameters

\Drupal\flexslider\Entity\Flexslider $flexslider: The Flexslider object to disable.

Return value

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

1 string reference to 'FlexsliderOptionsetController::disable'
flexslider.routing.yml in ./flexslider.routing.yml
flexslider.routing.yml

File

src/Controller/FlexsliderOptionsetController.php, line 37

Class

FlexsliderOptionsetController
Route controller class for the flexslider module options configuration.

Namespace

Drupal\flexslider\Controller

Code

public function disable(Flexslider $flexslider) {
  $flexslider
    ->disable()
    ->save();
  return new RedirectResponse($flexslider
    ->toUrl('collection', [
    'absolute' => TRUE,
  ]));
}