Git Product home page Git Product logo

symfonylibrinfocorebundle's Introduction

SymfonyLibrinfoCoreBundle

The goal of this bundle is to make the use of SonataAdmin "view-models" possible without writting a line of PHP, without loosing a feature of Sonata, and importing the idea of composite settings using lots of characteristics of an admin (its direct inheritance tree, the traits used by its Entity, the inheritance tree of its Entity...), making things more flexible, extendable, reusable and maintenable through many bundles and uses.

This bundle is the next step after the SonataAdminBundle. Configure an entire backend bundle filling only YAML files... Try it!

It is also the core of the core of Libre Informatique's Symfony 2/3 projects.

Example

I want to design and create a bundle as a toolbox for other bundles' entities. It will provide traits for email addresses and phonenumbers, for instance (cf. LibrinfoBaseEntitiesBundle).

Using the LibrinfoCoreBundle, your "base" bundle will carry the traits, but also the way to display properties given by its traits in a SonataAdmin (which becomes a CoreAdmin) CRUD. Then using the traits of your "base" bundle in the entities of other bundles (also implementing the LibrinfoCoreBundle) will add the fields naturally, the columns in the list of objects, etc... as you set up for your trait in your "base" bundle, without having to write a line for this.

Imagine this feature appliable to 50 entities distributed in 10 bundles, and count in your mind the number of saved lines, the number of potential bugs avoided and the ease of maintenance when you want to change the nature of the field used by the provided email address or phonenumber... This is what the LibrinfoCoreBundle permits.

Installation

Prequiresites

  • having a working Symfony2 environment
  • having created a working Symfony2 app (including your DB and your DB link)
  • having composer installed (here in /usr/local/bin/composer, with /usr/local/bin in the path)

Downloading

$ composer require libre-informatique/core-bundle dev-master

This will download and install :

  • knplabs/knp-menu
  • knplabs/knp-menu-bundle
  • cocur/slugify
  • sonata-project/core-bundle
  • sonata-project/cache
  • sonata-project/block-bundle
  • sonata-project/exporter
  • twig/extensions
  • sonata-project/admin-bundle
  • sonata-project/doctrine-orm-admin-bundle
  • libre-informatique/core-bundle
  • libre-informatique/base-entities-bundle
  • twig/twig ^1.22.1

Sonata bundles

Please refer to the Sonata Project's instructions, foundable here : https://sonata-project.org/bundles/admin/2-3/doc/reference/installation.html

PostgreSQL

Create the database needed

If you are using PostgreSQL as your main database, you'll need to install postgresql-contrib and load the "uuid-ossp" extension :

  $ sudo apt-get install postgresql-contrib
  $ echo 'CREATE EXTENSION "uuid-ossp";' | psql [DB]

The "libre-informatique" bundles

Edit your app/AppKernel.php file and add your "libre-informatique" bundle, for instance the "libre-informatique/core-bundle" :

    // app/AppKernel.php
    // ...
    public function registerBundles()
    {
        $bundles = array(
            // ...
            
            // The libre-informatique bundles
            new Librinfo\CoreBundle\LibrinfoCoreBundle(),
            
            // your personal bundles
        );
    }

Usages

Configuring your SonataAdminBundle interfaces with YAML properties

Discover the configuration of the CoreBundle.

Going further...

Read more about the CoreBundle, and how to improve the SonataAdminBundle

Improving the SonataAdminBundle in a generic way

Configuring a standalone bundle

Discover the configuration of a standalone bundle.

Going further using the CoreAdmin

Instead of the Librinfo\CoreBundle\Admin\Traits\Base trait, you might be interested in :

  • Librinfo\CoreBundle\Admin\Traits\Embedded: if the current CoreAdmin aims to be embedded
  • Librinfo\CoreBundle\Admin\Traits\Embedding: if the current CoreAdmin aims to embed other forms and you want its embedding fields to be treated automatically

Creating new field types.

Using Sonata Project extensions

If needed, you can easly use the LibrinfoCoreBundle in combination with other bundles from the Sonata Project, for instance :

Please refer yourself to the proper documentation from the Sonata Project...

Managing entities dashboard groups

Discover the configuration of the dashboard.

Using LibrinfoCore command tools for patches

Discover how to implement patches

symfonylibrinfocorebundle's People

Contributors

betaglop avatar nicolassdw avatar papsou avatar romainsanchez avatar sentinellesduweb avatar

Watchers

 avatar  avatar  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.