You are here

public function FlexsliderOptionsetController::enable in Flex Slider 8.2

Enables a Flexslider object.

Parameters

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

Return value

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

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

File

src/Controller/FlexsliderOptionsetController.php, line 23

Class

FlexsliderOptionsetController
Route controller class for the flexslider module options configuration.

Namespace

Drupal\flexslider\Controller

Code

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