Category : symfony-4.4

Is it possible to create a URL with the Symfony Router with a custom query string parameter with no value? Ideally i’d like: https://crmpicco.co.uk/details?invalid_sms the code below gives me: https://crmpicco.co.uk/details?invalid_sms=1 $router->generate(‘crmpicco_personal_details’, [ ‘invalid_sms’ => 1 ]); I have tried passing null, but that is not an accepted value Source: Symfony4..

Read more

I am having issues overriding a label in my form in my Symfony 4.4 application: {{ form_row(form.legal, { ‘label’ : ‘personal.form.fields.legal’|trans }) }} personal.form.fields.legal looks like this: I agree that I am 18 and above, I have read and accept the <a href="/terms-cond">T&Cs</a> My form definition: ->add(‘legal’, CheckboxType::class, ‘required’ => true, ‘mapped’ => false, ]) ..

Read more

in config/packages/framework.yaml # see https://symfony.com/doc/current/reference/configuration/framework.html framework: secret: ‘%env(APP_SECRET)%’ #csrf_protection: true #http_method_override: true # Enables session support. Note that the session will ONLY be started if you read or write from it. # Remove or comment this section to explicitly disable session support. session: handler_id: null cookie_secure: auto cookie_samesite: lax #esi: true #fragments: true php_errors: log: ..

Read more

in config/packages/framework.yaml # see https://symfony.com/doc/current/reference/configuration/framework.html framework: secret: ‘%env(APP_SECRET)%’ #csrf_protection: true #http_method_override: true # Enables session support. Note that the session will ONLY be started if you read or write from it. # Remove or comment this section to explicitly disable session support. session: handler_id: null cookie_secure: auto cookie_samesite: lax #esi: true #fragments: true php_errors: log: ..

Read more

How I can return a message after checkPostAuth in Symfony 4.4? We can use: CustomUserMessageAuthenticationException, but it’s only on Symfony 5. <?php namespace AppSecurity; use AppEntityUser; use SymfonyComponentSecurityCoreExceptionCustomUserMessageAuthenticationException; use SymfonyComponentSecurityCoreUserUserCheckerInterface; use SymfonyComponentSecurityCoreUserUserInterface; class UserChecker implements UserCheckerInterface { public function checkPreAuth (UserInterface $user) { if (!$user instanceof User) { return; } } public function checkPostAuth(UserInterface $user) ..

Read more