Cool description.
Explain different layers.
src
└── Acme
└── Foo
├── Application
│ └── FooBundle
│ ├── Controller
│ ├── DependencyInjection
│ │ └── Compiler
│ └── Resources
│ ├── config
│ └── views
├── Domain
│ ├── Component
│ ├── Event
│ ├── Exception
│ ├── Model
│ ├── Repository
│ ├── Service
│ └── Value
├── Infrastructure
│ ├── Mapping
│ │ └── Doctrine
│ │ └── ORM
│ ├── Migrations
│ │ └── Doctrine
│ ├── Repository
│ │ └── Doctrine
│ │ └── ORM
│ └── Service
└── Tests
├── Domain
│ ├── Component
│ ├── Event
│ ├── Model
│ ├── Service
│ └── Value
└── Infrastructure
└── Service
-
Clone the project:
git clone https://github.com/regniblod/symfony-ddd.git {your_proyect_folder}
-
Go to the project folder:
cd {your_proyect_folder}
-
Remove all the
.gitkeep
files:find . -name .git -prune -o -type d -empty -exec touch {}/.gitkeep \;
-
Install dependencies:
composer install
-
Add a new module using instructions below.
-
Copy folder structure from
Foo
module. -
Add the configuration to this files, changing the path and the bundle name in each case:
app/config.yml
:
imports:
...
- { resource: "@AcmeFooBundle/Resources/config/services.yml" }
...
doctrine:
...
orm:
...
mappings:
AcmeFooBundle:
type: yml
dir: '%kernel.root_dir%/../src/Acme/Foo/Infrastructure/Mapping/Doctrine/ORM'
prefix: Acme\Foo\Domain\Model
alias: AcmeFooBundle
is_bundle: false
app/routing.yml
:
foo:
resource: "@AcmeFooBundle/Controller/"
type: annotation
app/AppKernel.php
:
<?php
public function registerBundles()
{
$bundles = [
...
new Acme\Foo\Application\FooBundle\AcmeFooBundle(),
];
...
return $bundles;
}
- Moein Akbarof and our work at trivago.
- https://github.com/PhpFriendsOfDdd/state-of-the-union
- https://github.com/josecelano/ddd-symfony-sample
- https://github.com/tyx/ddd-sample-symfony
- https://github.com/leopro/trip-planner
- https://github.com/tyx/cqrs-php-sandbox
- https://github.com/dddinphp/ddd
- https://github.com/codeliner/php-ddd-cargo-sample
- https://github.com/qandidate-labs/broadway
- https://github.com/jgimeno/taskreporter
- https://github.com/ddd-php/ddd-components
- Create command to generate automagically a new module.