development-x / media-service-provider
MediaServiceProvider for Silex framework
2.0.0
2017-03-18 18:39 UTC
Requires
- php: >=5.5.9
- doctrine/orm: ~2.5
- silex/silex: ~2.0
- symfony/config: ~3.0
- symfony/form: ~3.0
- symfony/translation: ~3.0
- symfony/twig-bridge: ~3.0
- twig/twig: ~1.3
Suggests
- symfony/config: Required by symfony/translation
- symfony/translation: Required by symfony/form
- symfony/twig-bridge: Required for render fast forms with symfony/form
README
Media Service Provider
Adding media service provider (inspired by SonataMediaBundle)
Features
- Adding DoctrineORM Entity for hold db records.
- Customized templates
Requirements
- PHP 5.3+
- Pimple ~2.1
- Doctrine ~2.3
Installation
Install with Composer, run:
composer require development-x/media-service-provider
Register first
<?php use Silex\Application; $app->register(new \Media\media-service-provider())
Create entity Media, and extend Base Entity
<?php namespace App\Entity; use Media\Entity\Media AS BaseMedia; /** * * @Entity * @HasLifecycleCallbacks * @Table(name="media_attachments") */ class Media extends BaseMedia { /** * @var integer * * @Column(name="id", type="integer") * @Id * @GeneratedValue(strategy="AUTO") */ protected $id; /** * Get id * * @return integer */ public function getId() { return $this->id; } }
ToDo
- Add more functionality
- Add more unit tests
Contributing
However, if you are interested and want to send a bug fix, new functionality or better realization, just send a pull request :) travis