2017 © Pedro Peláez
 

symfony-bundle crud-bundle-lte

image

vaszev/crud-bundle-lte

  • Sunday, November 5, 2017
  • by vaszev
  • Repository
  • 1 Watchers
  • 0 Stars
  • 91 Installations
  • HTML
  • 0 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 9 Versions
  • 8 % Grown

The README.md

CRUD-LTE

Modified Symfony3 CRUD-LTE 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-lte, (*2)

via composer:, (*3)

$ composer install "vaszev/crud-lte-bundle":"~1.0"

in your AppKernel.php:, (*4)

new Lexik\Bundle\FormFilterBundle\LexikFormFilterBundle(),
new Vaszev\CrudLteBundle\VaszevCrudLteBundle(),
new Avanzu\AdminThemeBundle\AvanzuAdminThemeBundle(),

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\CrudLteBundle\Filter\NotDeletedFilter
      enabled: true
avanzu_admin_theme:
    bower_bin: %bower_path%

And put the following into your parameters.yml file:, (*7)

parameters:
  bower_path: 'c:\Users\anyone\AppData\Roaming\npm\bower'

backend header-footer

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

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

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

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

<footer></footer>

final steps

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

$ php bin/console assets:install --symlink
$ php bin/console doctrine:schema:update --force
$ php bin/console avanzu:admin:fetch-vendor

You're ready to go, (*12)

$ php bin/console vaszev:generate:crud-lte

The Versions