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\Generator\UrlGeneratorInterface;
|
||||
|
||||
|
||||
class TradeController extends AbstractController
|
||||
{
|
||||
#[Route('/trade/{id}', name: 'trade')]
|
||||
public function sendEmail(MailerInterface $mailer, Offering $offer, OfferingRepository $offeringRepository, WishRepository $wishRepository): Response
|
||||
{
|
||||
$user = $this->getUser();
|
||||
$mail_url = $this->generateUrl('user_public', [
|
||||
'id' => $offer->getByUser()->getId(),
|
||||
], UrlGeneratorInterface::ABSOLUTE_URL);
|
||||
|
||||
if($user != $offer->getByUser())
|
||||
{
|
||||
|
@ -35,9 +39,7 @@ class TradeController extends AbstractController
|
|||
->context([
|
||||
'user' => $user,
|
||||
'id' => $offer->getByUser()->getId(),
|
||||
'userOffersLink' => $this->generateUrl('user_public', [
|
||||
'id' => $offer->getByUser()->getId(),
|
||||
], UrlGeneratorInterface::ABSOLUTE_URL)
|
||||
'userOffersLink' => $mail_url,
|
||||
])
|
||||
;
|
||||
try
|
||||
|
|
Reference in a new issue