Log in
Interface

ContextInterface

Magento\Store\Model\StoreSwitcher\ContextInterface

What it does

This interface defines the contract for handling store switching context in Magento 2.

Developers use this when implementing store switcher functionality to access information about the source store, destination store, and the URL to redirect users after switching between different store views.

It's essential for maintaining context during multi-store navigation and ensuring proper redirects.

Public Methods

  • getFromStore()
  • getTargetStore()
  • getRedirectUrl()