/automapper-plus-demo-app

Symfony app demonstrating AutoMapperPlus

Primary LanguagePHPMIT LicenseMIT

AutoMapperPlus Demo App

A basic Symfony app demonstrating the usage of AutoMapper+ and its bundle.

Points of interest

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 with automapper_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.

Running the app

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.

screenshot running app