create site with form to add offerings
This commit is contained in:
parent
781c8602d9
commit
b212d1fa74
4 changed files with 53 additions and 0 deletions
|
@ -2,6 +2,8 @@
|
|||
|
||||
namespace App\Controller;
|
||||
|
||||
use App\Entity\Offering;
|
||||
use App\Form\OfferingFormType;
|
||||
use App\Repository\OfferingRepository;
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\AbstractController;
|
||||
|
@ -26,4 +28,17 @@ class AppController extends AbstractController
|
|||
'user' => $this->getUser(),
|
||||
]);
|
||||
}
|
||||
|
||||
#[Route('/new', name: 'new_listing')]
|
||||
public function new_listing(): Response
|
||||
{
|
||||
$offering = new Offering();
|
||||
$form = $this->createForm(OfferingFormType::class, $offering);
|
||||
|
||||
|
||||
return $this->render('app/new_listing.html.twig', [
|
||||
'user' => $this->getUser(),
|
||||
'offering_form' => $form->createView(),
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
|
Reference in a new issue