force use of RouterInterface
This commit is contained in:
parent
c20afb737a
commit
15666fc92d
1 changed files with 4 additions and 2 deletions
|
@ -15,15 +15,17 @@ use Symfony\Component\Mailer\MailerInterface;
|
|||
use Symfony\Component\Mime\Email;
|
||||
use Symfony\Component\Routing\Annotation\Route;
|
||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||
use Symfony\Component\Routing\RouterInterface;
|
||||
|
||||
|
||||
class TradeController extends AbstractController
|
||||
{
|
||||
#[Route('/trade/{id}', name: 'trade')]
|
||||
public function sendEmail(MailerInterface $mailer, Offering $offer, OfferingRepository $offeringRepository, WishRepository $wishRepository): Response
|
||||
public function sendEmail(MailerInterface $mailer, Offering $offer, OfferingRepository $offeringRepository, WishRepository $wishRepository, RouterInterface $router): Response
|
||||
{
|
||||
$user = $this->getUser();
|
||||
$mail_url = $this->generateUrl('user_public', [
|
||||
$this->router = $router;
|
||||
$mail_url = $this->router->generate('user_public', [
|
||||
'id' => $offer->getByUser()->getId(),
|
||||
], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
|
||||
|
|
Reference in a new issue