Relative Content

Tag Archive for symfony

Send emails with Symfony6 from OVH E-mails Pro

I am desperately trying to send emails via my Symfony 6 application using my OVH E-mails Pro address.
The address is functional in the sense that I can send emails via an email client, but I can’t do it from my Symfony application.

404 not found , function in symfony

public function forgetPassword($request) { $email = $request->get(’email’); $user = $this->em->getRepository(User::class)->findOneBy([‘username’ => $email]); if (!$user) { return [ ‘status’ => 400, ‘data’ => ‘You don’t have account with this email’ ]; } $newpassword = $this->generateUniqueCode(); $globalUtils = new GlobalUtils(); $globalUtils->SendForgotPasswordEmail($this->mailer, $email, [ ‘subject’ => ‘New password to ‘ . $user->getUsername() . ‘ ‘, ‘newPassword’ => $newpassword […]

Conditionally show parts of template based on user roles

I’m trying to understand how to conditionally show content in a template based on the roles assigned to a user. In the code below, would users with the ROLE_USER role be able to see the edit and delete button or only users with the ROLE_ADMIN role? Would they need to be assigned both roles to see those buttons?

Symfony Create Function (Beginner)

I’m quite new to php, trying my hardest to make data from the Table pop up! Can someone check why this doesn’t work? Tried redownloading symfony, but still doesn’t seem like to work.

Error: The schema provider is not available

I’m encountering an issue with Doctrine Migrations in my Symfony application. When I try to run migrations using the command**php bin/console doctrine:migrations:migrate**, I’m getting the following error:

Symfony clear cart is not fully working fully

#[Route(‘/clear/winkelwagen’, name: ‘clear_winkelwagen’)]
public function clearWinkelwagen(EntityManagerInterface $em, Request $request): Response
{
$request->getSession()->remove(‘order’);
return $this->redirectToRoute(‘app_winkelwagen’);

Refresh field value without reload page

I’m currelty work in symfony 7 application with messenger. I would like to update entity field value in a handler. The handler is working in async. I would like the people in the page not need to reload page for update value. Is this possible ?