2017 © Pedro Peláez
 

symfony-bundle crud-bundle

image

vaszev/crud-bundle

  • Thursday, September 1, 2016
  • by vaszev
  • Repository
  • 1 Watchers
  • 1 Stars
  • 25 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 8 Versions
  • 0 % Grown

The README.md

CRUD

Modified Symfony3 CRUD generator

Many thanks to Jordi Llonch for his CrudGeneratorBundle (https://github.com/jordillonch/CrudGeneratorBundle) that I've could modify. This bundle has a nice backend view for your entities. You can filtering, paginating, ordering, soft-deleting your data., (*1)

how to install:

https://packagist.org/packages/vaszev/crud-bundle, (*2)

via composer:, (*3)

$ composer install "vaszev/crud-bundle":"~2.0"

in your AppKernel.php:, (*4)

new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
new Vaszev\CrudBundle\VaszevCrudBundle(),

soft-delete

Implementing the soft-delete interface, you have to extend your entity. The Base superclass will add the following fields to your entity: id, deleted, created, edited., (*5)

class Document extends Base {}

Now, you have to enable the filter in your config.yml file:, (*6)

orm:
  filters:
    not_deleted:
      class:   Vaszev\CrudBundle\Filter\NotDeletedFilter
      enabled: true

backend header-footer

Let's create the following files:, (*7)

app\Resources\views\vaszevCrudMenu.html.twig (contains your custom styles and the backend menu too), (*8)

{% block stylesheets_sub %}{% endblock %}
{% block menu %}{% endblock %}

app\Resources\views\vaszevCrudFooter.html.twig (your personal/company informations goes here), (*9)

<footer></footer>

final steps

Don't forget to update your schema., (*10)

$ php app/console doctrine:schema:update --force

You're ready to go, (*11)

$ php app/console vaszev:generate:crud

The Versions