I propose to add the possibility of using the Form Component of Symfony to facilitate the creation of an Airtable recording.
For the moment I do not know how I will do it, but I get to work and propose a PR soon.
Concretely, in terms of use, I would see something like this :
class Foo
{
public int $id;
public string $bar;
}
class FooController
{
public function bar(AirtableClientInterface $airtableClient, Request $request)
{
$foo = new Foo();
$form = $airtableClient->createForm(['id', 'bar'], $foo);
$form->handleRequest($request);
if ($form->isSubmitted() && $form->isValid()) {
$foo = $form->getData();
$airtableClient->addOneRecord(
'tableName',
[
$foo,
Foo::class,
]
);
return $this->redirectToRoute('task_success');
}
return $this->render('foo/new.html.twig', [
'form' => $form->createView(),
]);
}
}
I propose to add the possibility of using the Form Component of Symfony to facilitate the creation of an Airtable recording. For the moment I do not know how I will do it, but I get to work and propose a PR soon.
Concretely, in terms of use, I would see something like this :