Download the PHP package glavweb/uploader-bundle without Composer
On this page you can find all versions of the php package glavweb/uploader-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package uploader-bundle
Installation
Get the bundle using composer
Add GlavwebUploaderBundle by running this command from the terminal at the root of your Symfony project:
Enable the bundle
To start using the bundle, register the bundle in your application's kernel class:
Configure the bundle
This bundle was designed to just work out of the box. The only thing you have to configure in order to get this bundle up and running is a mapping.
To enable the dynamic routes, add the following to your routing configuration file.
Basic Usage
- Added annotations for the entity which needs to support "GlavwebUploadable". "@Glavweb\Uploadable" before you can define an entity class:
And another annotation "@Glavweb\UploadableField" before defining the properties of a many-to-many:
Or many-to-one:
- For build form, you can use GlavwebUploaderDropzoneBundle.
Events
Bundle has 3 events:
- glavweb_uploader.validation; // First event, will execute before your file will be uploaded
- glavweb_uploader.pre_upload; // Will execute before your file will be uploaded
- glavweb_uploader.post_upload. // Will execute after your file will be uploaded
Example
As example we use post upload event.
services.yml:
post_upload_listener:
class: AppBundle\Listener\PostUploadListener
tags:
- { name: kernel.event_listener, event: glavweb_uploader.post_upload, method: onPostUpload }
Listener class:
namespace AppBundle\Listener;
use Glavweb\UploaderBundle\Event\PostUploadEvent;
class PostUploadListener
{
/**
* @param PostUploadEvent $event
*/
public function onPostUpload(PostUploadEvent $event)
{
// Some logic
}
}
Other listeners work on a similar logics.
Also you can define listeners only for your context, as example if context is "article":
article_post_upload_listener:
class: AppBundle\Listener\ArticlePostUploadListener
tags:
- { name: kernel.event_listener, event: glavweb_uploader.post_upload.article, method: onPostUpload }
All versions of uploader-bundle with dependencies
symfony/http-foundation Version ^2.7|^3.0|^4.0|^5.0
symfony/form Version ^2.7|^3.0|^4.0|^5.0
twig/twig Version ^2.12.1|^3.0
symfony/mime Version ^2.7|^3.0|^4.0|^5.0
symfony/filesystem Version ^2.7|^3.0|^4.0|^5.0
symfony/finder Version ^2.7|^3.0|^4.0|^5.0
symfony/translation Version ^2.7|^3.0|^4.0|^5.0