Download the PHP package sopinet/uploadfiles-bundle without Composer
On this page you can find all versions of the php package sopinet/uploadfiles-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package uploadfiles-bundle
uploadfiles-bundle
Instalation
-
Add this bundle to your composer.json file
-
Add to your AppKernel.php file
- Configure oneuploader-bundle:
- with basic configuration: https://github.com/1up-lab/OneupUploaderBundle/blob/master/Resources/doc/index.md#step-3-configure-the-bundle
- And Using the Orphanage configuration(for now configure the mappings as gallery) : https://github.com/1up-lab/OneupUploaderBundle/blob/master/Resources/doc/orphanage.md
-
Add the form type to your config, and this bundle to assetics config:
-
Add the routing to your routing.yml:
- Create your File entity, something like this:
Usage
-
Create your relationships between your project entities and your new entity field(respect the owning side for lifecicle callbacks and cascade):
-
Add the HasFileTrait or the HasFilesTrait to your entities:
-
Now you can already use this field type in your forms like this:
- If you want to use another style or template for dropbox you can overwrite the field style as follow(this example render dropbox with default aspect):
Using with sonata
- Using for one-to-one relationship, add to your config:
then use as in forms
- Using for one-to-many relationship, on add set a custom template for field
if you want to customize sonata render you can create your own block as follow
Types and styles added already on bundle
-
Types:
modal: replace dropbox box with button for display a modal with dropbox box inside pdf_preview: replace dropbox with a pdf preview(previews for multiples files), recommend use with style_none.
-
Styles:
style_default: just the regular dropbox style style_iconic: replace the dropbox box with a + icon style_none: non style
-
Types sonata preview:
pdf: same as pdf preview only work with one to one entity to file relationship to use add