---
title: "Mfa.ifHasState ViewHelper <be:mfa.ifHasState>"
manual: "Fluid ViewHelper Reference"
version: "13.4"
permalink: "https://docs.typo3.org/permalink/t3viewhelper:typo3-backend-mfa-ifhasstate@13.4"
source: "Backend/Mfa/IfHasState.rst"
modified: "2026-09-17T09:07:45+00:00"
---

# Mfa.ifHasState ViewHelper `<be:mfa.ifHasState>`

> [!NOTE]
> This ViewHelper is not available by default.
>
> [Import its namespace](https://docs.typo3.org/m/typo3/reference-coreapi/13.4/en-us/ApiOverview/Fluid/Index.html#fluid-syntax-viewhelpers-import-namespaces)
> `{namespace be=TYPO3\CMS\Backend\ViewHelpers\}` in the Fluid file or
> `xmlns:be="http://typo3.org/ns/TYPO3/CMS/Backend/ViewHelpers/"` in the opening HTML tag.

> [!WARNING]
> **Internal**
>
> This ViewHelper is marked as internal. It is subject to be changed without notice. Use at your own risk.

ViewHelper to check if the given provider for the current user has the requested state set.

Go to the source code of this ViewHelper: [Mfa\\IfHasStateViewHelper.php (GitHub)](https://github.com/TYPO3/typo3/blob/main/typo3/sysext/backend/Classes/ViewHelpers/Mfa/IfHasStateViewHelper.php).

## Arguments of the `<be:mfa.ifHasState>` ViewHelper

-   **else**

    -   *Type:* mixed

    Value to be returned if the condition if not met.

-   **provider**

    -   *Type:* TYPO3\\CMS\\Core\\Authentication\\Mfa\\MfaProviderManifestInterface
    -   *Required:* true

    The provider in question

-   **state**

    -   *Type:* string
    -   *Required:* true

    The state to check for (e.g. active or locked)

-   **then**

    -   *Type:* mixed

    Value to be returned if the condition if met.
