function SessionTestController::clearSessionBagFlag

Same name in other branches
  1. 9 core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php \Drupal\session_test\Controller\SessionTestController::clearSessionBagFlag()
  2. 8.9.x core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php \Drupal\session_test\Controller\SessionTestController::clearSessionBagFlag()
  3. 11.x core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php \Drupal\session_test\Controller\SessionTestController::clearSessionBagFlag()

Clears the test flag from the session test bag.

Parameters

\Symfony\Component\HttpFoundation\Request $request: The request object.

Return value

\Symfony\Component\HttpFoundation\Response The response object.

1 string reference to 'SessionTestController::clearSessionBagFlag'
session_test.routing.yml in core/modules/system/tests/modules/session_test/session_test.routing.yml
core/modules/system/tests/modules/session_test/session_test.routing.yml

File

core/modules/system/tests/modules/session_test/src/Controller/SessionTestController.php, line 223

Class

SessionTestController
Controller providing page callbacks for the action admin interface.

Namespace

Drupal\session_test\Controller

Code

public function clearSessionBagFlag(Request $request) {
    
    /** @var \Drupal\session_test\Session\TestSessionBag */
    $bag = $request->getSession()
        ->getBag(TestSessionBag::BAG_NAME);
    $bag->clearFlag();
    return new Response();
}

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