2017 © Pedro PelĂĄez
 

symfony-bundle cms-bundle

Simple admin generator bundle for your Symfony project

image

ob/cms-bundle

Simple admin generator bundle for your Symfony project

  • Thursday, July 28, 2016
  • by marcaube
  • Repository
  • 1 Watchers
  • 3 Stars
  • 283 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 2 Forks
  • 1 Open issues
  • 6 Versions
  • 0 % Grown

The README.md

Scrutinizer Code Quality SensioLabsInsight, (*1)

What this bundle is not 


  • Production ready
  • An example of beautiful code or best practices
  • A weapon against zombies
  • A bundle for power users

What it is 


  • A simple way to manage entities without writing too much code
  • A playground to become a better PHP dev

Features

  • Add CRUD actions for an entity in a couple of php lines
  • Row and multi-row actions, search, filters and pagination
  • Clean and simple UI

What it does not

  • Handle entity relations
  • Dashboard widgets
  • Security/Authentication
  • Solve world hunger

Installation

  • Run composer require ob/cms-bundle, (*2)

  • Register the bundles in your app/AppKernel.php:, (*3)

<?php
...
public function registerBundles()
{
    $bundles = array(
        ...
        new Ob\CmsBundle\ObCmsBundle(),
        new Mopa\Bundle\BootstrapBundle\MopaBootstrapBundle(),
        new Knp\Bundle\PaginatorBundle\KnpPaginatorBundle(),
        new Liuggio\ExcelBundle\LiuggioExcelBundle(),
        ...
    );
...
  • Add configuration for Mopa Bundle
# app/config/config.yml
mopa_bootstrap:
    form: ~
  • Last thing but not least is to import the routing
# app/config/routing.yml
ob_cms:
    resource: "@ObCmsBundle/Resources/config/routing.yml"
    prefix:   /the-admin-prefix-of-your-choice

Create an Admin class

To use the Cms, you must create an Admin class somewhere in your bundle. For complete list of options, dive in the Admin class code, it's pretty simple., (*4)

<?php

namespace Ob\CmsDemoBundle\Admin;

use Ob\CmsBundle\Admin\AbstractAdmin as Admin;

class GuitarAdmin extends Admin
{
    public function __construct()
    {
        $this->class = 'Ob\CmsDemoBundle\Entity\Guitar';
    }

    public function listDisplay()
    {
        return array('name', 'brand', 'strings', 'price', 'online');
    }

    public function formDisplay()
    {
        return array('name', 'brand', 'strings', 'price', 'online');
    }
}

And then register your new admin class as a tagged service. The alias tag is used for the menu and the translation prefix., (*5)

# Ob/CmsDemoBundle/Resources/services.yml
services:
    ob_cms_demo.guitar.admin:
        class: Ob\CmsDemoBundle\Admin\GuitarAdmin
        tags:
            -  { name: ob.cms.admin, alias: guitar }

The Versions

28/07 2016

dev-sf3

dev-sf3 https://github.com/marcaube/ObCmsBundle

Simple admin generator bundle for your Symfony project

  Sources   Download

MIT

The Requires

 

symfony2 generator cms admin ob marcaube

12/01 2016

dev-master

9999999-dev https://github.com/marcaube/ObCmsBundle

Simple admin generator bundle for your Symfony project

  Sources   Download

MIT

The Requires

 

symfony2 generator cms admin ob marcaube

12/01 2016

0.1.3

0.1.3.0 https://github.com/marcaube/ObCmsBundle

Simple admin generator bundle for your Symfony project

  Sources   Download

MIT

The Requires

 

symfony2 generator cms admin ob marcaube

21/01 2015

0.1.2

0.1.2.0 https://github.com/marcaube/ObCmsBundle

Simple admin generator bundle for your Symfony project

  Sources   Download

MIT

The Requires

 

symfony2 generator cms admin ob marcaube

18/01 2015
22/11 2014