function SystemController::compactPage

Same name in other branches
  1. 9 core/modules/system/src/Controller/SystemController.php \Drupal\system\Controller\SystemController::compactPage()
  2. 10 core/modules/system/src/Controller/SystemController.php \Drupal\system\Controller\SystemController::compactPage()
  3. 11.x core/modules/system/src/Controller/SystemController.php \Drupal\system\Controller\SystemController::compactPage()

Sets whether the admin menu is in compact mode or not.

Parameters

string $mode: Valid values are 'on' and 'off'.

Return value

\Symfony\Component\HttpFoundation\RedirectResponse

1 string reference to 'SystemController::compactPage'
system.routing.yml in core/modules/system/system.routing.yml
core/modules/system/system.routing.yml

File

core/modules/system/src/Controller/SystemController.php, line 182

Class

SystemController
Returns responses for System routes.

Namespace

Drupal\system\Controller

Code

public function compactPage($mode) {
    user_cookie_save([
        'admin_compact_mode' => $mode == 'on',
    ]);
    return $this->redirect('<front>');
}

Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.