Download the PHP package 2lenet/attachment-bundle without Composer
On this page you can find all versions of the php package 2lenet/attachment-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download 2lenet/attachment-bundle
More information about 2lenet/attachment-bundle
Files in 2lenet/attachment-bundle
Package attachment-bundle
Short Description Attachment
License MIT
Informations about the package attachment-bundle
AttachmentBundle
Installation
composer req 2lenet/attachment-bundle
Add to your config/routes.yaml ( no flex reciepe for the moment ).
Embed controller in a template
Or with field if you want only an group of attachment
Like that you can use "lle.attachment" action with EasyAdminPlusBundle:
Or with field if you want only an group of attachment
Information: the lle.attachment is a alias of lle.attachment.show.action
Easy use
render the widget for upload:
render the list (ul) for download:
You can use several attachment on the same template
Configurations
with default value
Thanks to use
pre load for list of entities:
If you list 20 entities with 20 call of {{ list_attachment(entity) }} you want 1 request not 20:
call
exemple with EasyAdmin
add uploaded file in form
-
Add UploadedFileAttachmentInterface with UploadedFileAttachmentTrait at your entity
-
In your entity form add
-
Now you have to call addFileByEntity after persist (entity identification have to be create)
-
here an simple exemple with EasyAdmin:
-
if you want you can defin the default filed in entity
- For validation use Symfony validator annotations or validator in form (Advice: if you use validator annotation create your own Trait)
All versions of attachment-bundle with dependencies
antishov/doctrine-extensions-bundle Version ^1.4
symfony/mime Version ^4.3 || ^5.0