user: current location edit form and page

This commit is contained in:
nobohan
2021-11-17 11:35:54 +01:00
parent 32c7695d80
commit 5905038425
4 changed files with 121 additions and 25 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace Chill\MainBundle\Form;
use Chill\MainBundle\Entity\Location;
use Symfony\Bridge\Doctrine\Form\Type\EntityType;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
class UserCurrentLocationType extends AbstractType
{
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->add('location', EntityType::class, [
'class' => Location::class,
'choice_label' => function (Location $entity) {
return $entity->getName();
},
]);
}
}