generate url first
This commit is contained in:
parent
67f756436e
commit
0dab627482
1 changed files with 5 additions and 3 deletions
|
@ -16,12 +16,16 @@ use Symfony\Component\Mime\Email;
|
||||||
use Symfony\Component\Routing\Annotation\Route;
|
use Symfony\Component\Routing\Annotation\Route;
|
||||||
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
|
||||||
|
|
||||||
|
|
||||||
class TradeController extends AbstractController
|
class TradeController extends AbstractController
|
||||||
{
|
{
|
||||||
#[Route('/trade/{id}', name: 'trade')]
|
#[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): Response
|
||||||
{
|
{
|
||||||
$user = $this->getUser();
|
$user = $this->getUser();
|
||||||
|
$mail_url = $this->generateUrl('user_public', [
|
||||||
|
'id' => $offer->getByUser()->getId(),
|
||||||
|
], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||||
|
|
||||||
if($user != $offer->getByUser())
|
if($user != $offer->getByUser())
|
||||||
{
|
{
|
||||||
|
@ -35,9 +39,7 @@ class TradeController extends AbstractController
|
||||||
->context([
|
->context([
|
||||||
'user' => $user,
|
'user' => $user,
|
||||||
'id' => $offer->getByUser()->getId(),
|
'id' => $offer->getByUser()->getId(),
|
||||||
'userOffersLink' => $this->generateUrl('user_public', [
|
'userOffersLink' => $mail_url,
|
||||||
'id' => $offer->getByUser()->getId(),
|
|
||||||
], UrlGeneratorInterface::ABSOLUTE_URL)
|
|
||||||
])
|
])
|
||||||
;
|
;
|
||||||
try
|
try
|
||||||
|
|
Reference in a new issue