Download the PHP package flexmodel/flexmodel-bundle without Composer
On this page you can find all versions of the php package flexmodel/flexmodel-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download flexmodel/flexmodel-bundle
More information about flexmodel/flexmodel-bundle
Files in flexmodel/flexmodel-bundle
Package flexmodel-bundle
Short Description FlexModel integration for Symfony 3+.
License MIT
Informations about the package flexmodel-bundle
FlexModelBundle
FlexModel integration for Symfony.
Installation using Composer
Run the following command to add the package to the composer.json of your project:
Enable the bundle
Enable the bundle in the kernel:
Configure the bundle
Add the following configuration to your config.yml
file:
The resource
should refer to the location of your FlexModel configuration file.
Usage
Generating Doctrine ORM mapping
Run the following command to generate Doctrine ORM mapping and entity classes from your FlexModel configuration:
After generating the Doctrine ORM mapping you need to update your database schema:
Creating a Form
To create a form from a FlexModel form configuration you need to use the FlexModelFormType
class.
The class will retrieve the form configuration based on the name of the entity and provided 'form_name' option.
For more information on creating forms, please see the Symfony documentation.
File uploads
The FlexModelBundle provides support for file uploads within FlexModel forms.
To activate this support you need to complete the following steps:
1. Configure the FlexModelBundle for file uploads
The bundle requires a location to store the file uploads.
Configure the location with the existing FlexModelBundle configuration in your config.yml
file:
2. Modify your Doctrine entity class
To activate file uploads for a Doctrine entity you need to implement the UploadObjectInterface
and add getters and setters for the form fields.
For ease of use the FlexModelBundle provides an UploadTrait
to implement both the interface and the getters and setters:
In the above example you see the UploadTrait
with getters and setters for two file upload fields implemented.
Here the getImageUpload
method maps to a FlexModel field called 'image' and getAnotherImageUpload
maps to 'another_image'.
Credits
- Niels Nijens
- All Contributors
License
This package is licensed under the MIT License. Please see the LICENSE file for details.
All versions of flexmodel-bundle with dependencies
ext-libxml Version *
ext-xsl Version *
doctrine/orm Version ^2.5
flexmodel/flexmodel Version ^1.0
ocramius/proxy-manager Version ^1.0 | ^2.0
symfony/console Version ^2.8 | ^3.0
symfony/form Version ^2.8 | ^3.0
symfony/framework-bundle Version ^2.8 | ^3.0
symfony/validator Version ^2.8 | ^3.0
twig/twig Version ^1.24 | ^2.0