A basic Symfony app demonstrating the usage of AutoMapper+ and its bundle.
This app should give you some insight on how to use the AutoMapper+ bundle. Following things are of interest:
- The config file:
This is where the mappings are being registered. Because the demo app is super small, all the config resides in a single file. Should the complexity of your app grow, it might be desired to split the config. - The config service definition:
For a configurator to be recognized, it has to be tagged withautomapper_plus.configurator
. If you have autowiring enabled, this will be handled automatically. - The ViewModel directory:
This is where the viewmodels for the Post entity are defined. - The form types:
These are attached to the viewmodels instead of the entity.
The main goal of this project is to provide you some code to browse through. Should you want to run the application yourself, you'll need to perform following steps:
$ git clone https://github.com/mark-gerarts/automapper-plus-bundle.git
$ cd automapper-plus-bundle
$ mkdir var/data
$ composer install
$ bin/console doctrine:schema:update --force
$ bin/console server:start
You'll need the following as well:
- PHP7.1+
- sqlite3 driver
With everything setup, you can navigate to localhost/blog to see the running app.