This is the core of Libre Informatique Symfony2 projects
- 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)
$ 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
Please refer to the Sonata Project's instructions, foundable here : https://sonata-project.org/bundles/admin/2-3/doc/reference/installation.html
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]
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
);
}
Discover the configuration of the CoreBundle
.
Improving the SonataAdminBundle in a generic way
Discover the configuration of a standalone bundle.
Instead of the Librinfo\CoreBundle\Admin\Traits\Base
trait, you might be interested in :
Librinfo\CoreBundle\Admin\Traits\Embedded
: if the currentCoreAdmin
aims to be embeddedLibrinfo\CoreBundle\Admin\Traits\Embedding
: if the currentCoreAdmin
aims to embed other forms and you want its embedding fields to be treated automatically
If needed, you can easly use the LibrinfoCoreBundle in combination with other bundles from the Sonata Project, for instance :
- sonata-project/intl-bundle
- sonata-project/notification-bundle
- sonata-project/user-bundle
- sonata-project/formatter-bundle
Please refer yourself to the proper documentation from the Sonata Project...