modalité uploder des ficher avec VichUploaderBundle
This commit is contained in:
@@ -8,4 +8,5 @@ return [
|
||||
Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle::class => ['all' => true],
|
||||
Symfony\Bundle\SecurityBundle\SecurityBundle::class => ['all' => true],
|
||||
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
|
||||
Vich\UploaderBundle\VichUploaderBundle::class => ['all' => true],
|
||||
];
|
||||
|
||||
0
config/packages/csrf.yaml
Normal file → Executable file
0
config/packages/csrf.yaml
Normal file → Executable file
15
config/packages/vich_uploader.yaml
Executable file
15
config/packages/vich_uploader.yaml
Executable file
@@ -0,0 +1,15 @@
|
||||
vich_uploader:
|
||||
db_driver: orm
|
||||
|
||||
mappings:
|
||||
attachments:
|
||||
uri_prefix: /uploads/questions
|
||||
upload_destination: '%kernel.project_dir%/public/uploads/questions'
|
||||
namer: Vich\UploaderBundle\Naming\UniqidNamer
|
||||
directory_namer: ~
|
||||
|
||||
inject_on_load: false
|
||||
delete_on_update: true
|
||||
delete_on_remove: true
|
||||
# Optionnel : pour générer des URLs absolues
|
||||
# uri_prefix_absolute: true
|
||||
@@ -1242,6 +1242,44 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
* intercept_redirects?: bool, // Default: false
|
||||
* excluded_ajax_paths?: scalar|null, // Default: "^/((index|app(_[\\w]+)?)\\.php/)?_wdt"
|
||||
* }
|
||||
* @psalm-type VichUploaderConfig = array{
|
||||
* default_filename_attribute_suffix?: scalar|null, // Default: "_name"
|
||||
* db_driver: scalar|null,
|
||||
* storage?: scalar|null, // Default: "file_system"
|
||||
* use_flysystem_to_resolve_uri?: bool, // Default: false
|
||||
* twig?: scalar|null, // twig requires templating // Default: true
|
||||
* form?: scalar|null, // Default: true
|
||||
* metadata?: array{
|
||||
* cache?: scalar|null, // Default: "file"
|
||||
* type?: scalar|null, // Default: "attribute"
|
||||
* file_cache?: array{
|
||||
* dir?: scalar|null, // Default: "%kernel.cache_dir%/vich_uploader"
|
||||
* },
|
||||
* auto_detection?: bool, // Default: true
|
||||
* directories?: list<array{ // Default: []
|
||||
* path: scalar|null,
|
||||
* namespace_prefix?: scalar|null, // Default: ""
|
||||
* }>,
|
||||
* },
|
||||
* mappings?: array<string, array{ // Default: []
|
||||
* uri_prefix?: scalar|null, // Default: "/uploads"
|
||||
* upload_destination?: scalar|null, // Default: null
|
||||
* namer?: string|array{
|
||||
* service?: scalar|null, // Default: null
|
||||
* options?: mixed, // Default: null
|
||||
* },
|
||||
* directory_namer?: string|array{
|
||||
* service?: scalar|null, // Default: null
|
||||
* options?: mixed, // Default: null
|
||||
* },
|
||||
* delete_on_remove?: scalar|null, // Default: true
|
||||
* erase_fields?: scalar|null, // Default: true
|
||||
* delete_on_update?: scalar|null, // Default: true
|
||||
* inject_on_load?: scalar|null, // Default: false
|
||||
* namer_keep_extension?: scalar|null, // Default: false
|
||||
* db_driver?: scalar|null, // Default: null
|
||||
* }>,
|
||||
* }
|
||||
* @psalm-type ConfigType = array{
|
||||
* imports?: ImportsConfig,
|
||||
* parameters?: ParametersConfig,
|
||||
@@ -1251,6 +1289,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
* doctrine?: DoctrineConfig,
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* security?: SecurityConfig,
|
||||
* vich_uploader?: VichUploaderConfig,
|
||||
* "when@dev"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
* parameters?: ParametersConfig,
|
||||
@@ -1262,6 +1301,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* security?: SecurityConfig,
|
||||
* web_profiler?: WebProfilerConfig,
|
||||
* vich_uploader?: VichUploaderConfig,
|
||||
* },
|
||||
* "when@prod"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
@@ -1272,6 +1312,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
* doctrine?: DoctrineConfig,
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* security?: SecurityConfig,
|
||||
* vich_uploader?: VichUploaderConfig,
|
||||
* },
|
||||
* "when@test"?: array{
|
||||
* imports?: ImportsConfig,
|
||||
@@ -1283,6 +1324,7 @@ namespace Symfony\Component\DependencyInjection\Loader\Configurator;
|
||||
* doctrine_migrations?: DoctrineMigrationsConfig,
|
||||
* security?: SecurityConfig,
|
||||
* web_profiler?: WebProfilerConfig,
|
||||
* vich_uploader?: VichUploaderConfig,
|
||||
* },
|
||||
* ...<string, ExtensionType|array{ // extra keys must follow the when@%env% pattern or match an extension alias
|
||||
* imports?: ImportsConfig,
|
||||
|
||||
Reference in New Issue
Block a user