mirror of
https://github.com/alrayyes/wiki.git
synced 2024-12-01 15:26:23 +00:00
40 lines
775 B
Markdown
40 lines
775 B
Markdown
|
---
|
||
|
id: 70afdac5-245d-4bc5-920c-5d1b48d5fb5e
|
||
|
title: IS~REMEMBERED~
|
||
|
---
|
||
|
|
||
|
# Description
|
||
|
|
||
|
Checks if user is a "Remember Me" user. Replaces
|
||
|
[IS~AUTHENTICATEDFULLY~](20201116121711-is_authenticated_fully) &
|
||
|
[IS~AUTHENTICATEDREMEMBERED~](20201116121636-is_authenticated_remembered)
|
||
|
|
||
|
# Syntax
|
||
|
|
||
|
``` php
|
||
|
// BEFORE
|
||
|
if ($this->isGranted('IS_AUTHENTICATED_REMEMBERED')
|
||
|
&& !$this->isGranted('IS_AUTHENTICATED_FULLY')) {
|
||
|
// ...
|
||
|
}
|
||
|
|
||
|
// AFTER
|
||
|
if ($this->isGranted('IS_REMEMBERED')) {
|
||
|
// ...
|
||
|
}
|
||
|
```
|
||
|
|
||
|
``` twig
|
||
|
{# BEFORE #}
|
||
|
{% if is_granted('IS_AUTHENTICATED_ANONYMOUSLY')
|
||
|
and not is_granted('IS_AUTHENTICATED_REMEMBERED')
|
||
|
and not is_granted('IS_AUTHENTICATED_FULLY') %}
|
||
|
{# ... #}
|
||
|
{% endif %}
|
||
|
|
||
|
{# AFTER #}
|
||
|
{% if is_granted('IS_ANONYMOUS') %}
|
||
|
{# ... #}
|
||
|
{% endif %}
|
||
|
```
|