GithubHelp home page GithubHelp logo

guoyu07 / symfony-ddd-edition Goto Github PK

View Code? Open in Web Editor NEW

This project forked from jeancsil/symfony-ddd-edition

0.0 0.0 0.0 55 KB

Symfony-standard distribution with DDD architecture.

ApacheConf 5.74% PHP 86.30% HTML 7.95%

symfony-ddd-edition's Introduction

Symfony-Standard DDD Edition

Cool description.

Architecture

Explain different layers.

Folder structure

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

How to use

  1. Clone the project: git clone https://github.com/regniblod/symfony-ddd.git {your_proyect_folder}

  2. Go to the project folder: cd {your_proyect_folder}

  3. Remove all the .gitkeep files: find . -name .git -prune -o -type d -empty -exec touch {}/.gitkeep \;

  4. Install dependencies: composer install

  5. Add a new module using instructions below.

How to add a new module

  1. Copy folder structure from Foo module.

  2. 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;
}

Inspiration

Other implementations:

ToDo

  • Create command to generate automagically a new module.

symfony-ddd-edition's People

Contributors

regniblod avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.