app/components/services/storageService/StorageService.js:
import {AsyncStorage} from 'react-native';
export default class StorageService {
static getAsyncStorageItem(key) {
return new Promise((resolve, reject) => {| <?php | |
| // Function | |
| /** | |
| * Get the array max depth. | |
| * | |
| * @param array $array | |
| * | |
| * @return int | |
| */ | |
| private function getArrayMaxDepth(array $array): int |
Redirects to browser preferred locale if this locale is supported by the application.
config/services.yml
App\EventListener\LocaleRedirectToClientPreference:
arguments:
$router: '@router'
$defaultLocale: '%kernel.default_locale%' # framework.default_locale in config/packages/translation.yamlAlso supports DOM elements existent on document load. Potentially heavier on performance than "classic" selector.
Selector
/*
Used instead of $('.my-element').click(function (e) {} to be able to listen to click on elements with my-element class
created by JS insertion into DOM after document load.Password rehash on login if needed is natively handled by Symfony since 4.4. See https://symfony.com/blog/new-in-symfony-4-4-password-migrations.
The legacy password hashes migration part might still be of use though, but beware of password shucking: If the legacy hash is not salted and is present in data breaches from other platforms, overhashing might have little to no effect.
config/packages/security.yaml
security:See https://symfony.com/doc/current/frontend/encore/server-data.html for context.
Twig filter to merge arrays with array_merge_recursive() instead of array_merge(). Required to prevent Twig merge filter from overwritting twig_to_js_global_data string keys if extra_data has identical keys (e.g. both have a translations key).
Add this to your _base.html.twig, probably just before {% block javascripts %}
onKernelResponse() methodconfig/response_header_setter/response_headers.yaml