add site to view and upload files

Reviewed-on: sites/file-explorer#4
This commit is contained in:
2024-12-05 09:42:25 +00:00
parent 1ec2ed1d00
commit bf226d7e3f
31 changed files with 2178 additions and 6 deletions

View File

@ -0,0 +1,25 @@
<?php
namespace App\Forms;
use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\Extension\Core\Type\FileType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Routing\Generator\UrlGeneratorInterface;
class UploadFileForm extends AbstractType
{
public function __construct(private readonly UrlGeneratorInterface $urlGenerator)
{
}
public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder
->setAction($this->urlGenerator->generate('app_upload'))
->add('file', FileType::class, [
'attr' => ['class' => 'hidden'],
'multiple' => true,
]);
}
}