Download the PHP package opifer/media-bundle without Composer
On this page you can find all versions of the php package opifer/media-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download opifer/media-bundle
More information about opifer/media-bundle
Files in opifer/media-bundle
Package media-bundle
Short Description Opifer Media Bundle
License MIT
Homepage https://github.com/Opifer/MediaBundle
Informations about the package media-bundle
MediaBundle
A Symfony Media Manager. Inspired by SonataMediaBundle's use of Media Providers to add different Media types.
Note: This bundle is still very much a work in progress, so BC-breaks will happen until the first stable release.
Installation
Install FOSJsRoutingBundle
according to it's documentation
Add the bundle to your composer.json
composer require opifer/media-bundle dev-master
Register the bundle and its dependencies in app/AppKernel.php
You should create your own Media entity that extends Opifer\MediaBundle\Model\Media
.
And reference to it in your app/config/config.yml
Using the media manager
This bundle comes with an AngularJS media manager included. To use it, you'll need to include some necessary javascript files and CSS files into your templates.
First, make sure you installed all asset dependencies. You can download them manually, copy the bower.json
file to your own bundle and run bower install
or copy the bower.json
content to your own bower dependencies.
Then, add the dependencies to your templates.
Then, create an Angular module that requires the following modules:
Make sure you add the angular module in your template by adding the the file to your {% javascripts %}
list.
And initialize the Angular App
in your template:
To make the mediamanager accessible in the browser, add the routes to your routing.yml
:
To use the mediamanager in your own layout, override OpiferMediaBundle::base.html.twig
:
Adding a mediapicker to a form
Create a relationship between the media entity and any other entity. For example, Users must be able to add media to a Content item.
In your content FormType, add the mediapicker
form type:
Documentation
- Configuration reference
- Media providers
All versions of media-bundle with dependencies
symfony/symfony Version ~2.5
doctrine/orm Version ~2.4
doctrine/doctrine-bundle Version ~1.2
twig/extensions Version ~1.0
aws/aws-sdk-php Version 2.5.*
gedmo/doctrine-extensions Version ~2.3
jms/serializer-bundle Version ~1.0
knplabs/knp-gaufrette-bundle Version *@dev
liip/imagine-bundle Version ~1.2.6
pagerfanta/pagerfanta Version ~1.0