CRUDlex is an easy to use CRUD generator for Symfony 4 and Silex 2 which is great for auto generated admin pages

Last update: Nov 19, 2021

CRUDlex

CRUDlex is an easy to use, well documented and tested CRUD generator for Symfony 4 and Silex 2. It is very useful to generate admin pages for example.

Support via Gratipay

List View of CRUDlex

Features

  • Generates a web application for managing MySQL stored data
    • C reate entries
    • R ead entries in a list and the details of single ones
    • U pdate entries
    • D elete entries
  • The list of entries is paginated, sortable and filterable
  • The entries can be relational, one-to-many and many-to-many is supported
  • Managing files is supported, either stored in the filesystem or at AWS S3 as addon
  • The UI is available in multiple languages
  • File storage is abstract, implementing other systems than the filesystem and AWS S3 is easy
  • Data storage is abstract, implementing other backends than MySQL is easy

Total Downloads Latest Stable Version Latest Unstable Version License

Build Status Code Coverage

SensioLabsInsight Scrutinizer Code Quality

Usage

As CRUDlex is framework agnostic, it is not used directly. There are framework specific implementations available:

Head over to the documentation for setup instructions.

CRUDlex uses SemVer for versioning. Currently, the API changes quickly due to be < 1.0.0, so take care about notes in the changelog when upgrading.

Documentation

Upcoming development version:

Sample Project

For a complete example, checkout the sample project with the classic libraries and books:

Addons

There are several surrounding projects around CRUDlex:

  • CRUDlexUser: A library offering an user provider for symfony/security

Roadmap

The project roadmap is organized via milestones:

CRUDlex Milestones

Beware that not each new feature will get its own ticket there. Some are implemented on the fly when needed.

Each milestone is loosely organized as project in the columns "Backlog" (Todo), "Staging" (Being worked on (next)) and "Done" (done):

CRUDlex Milestone Projects

Older Versions Documentation

Manual

The manual is a reference describing every feature of CRUDlex:

API Documentation

The CRUDlex API itself is documented here:

Build Notes

How to generate the API documentation:

vendor/bin/sphpdox process CRUDlex src  

How to build the documentation:

# Install dependencies
pip install Sphinx
pip install tk.phpautodoc
pip install sphinx_tabs
# Generate:
cd docs
make html

GitHub

https://github.com/philiplb/CRUDlex
Comments
  • 1. Identifier "twig.loader.filesystem" does not contain an object definition.

    Hi! Fresh install with Silex-Skeleton, composer edited to require Doctrine DBAL and CRUDlex (which implies more recent versions of twig-bridge and translation):

    "require": {
            "php": ">=5.5.9",
            "silex/silex": "~2.0",
            "silex/web-profiler": "~2.0",
            "symfony/asset": "~2.8|3.0.*",
            "symfony/browser-kit": "~2.8|3.0.*",
            "symfony/class-loader": "~2.8|3.0.*",
            "symfony/config": "~2.8|3.0.*",
            "symfony/console": "~2.8|3.0.*",
            "symfony/css-selector": "~2.8|3.0.*",
            "symfony/debug": "~2.8|3.0.*",
            "symfony/finder": "~2.8|3.0.*",
            "symfony/form": "~2.8|3.0.*",
            "symfony/monolog-bridge": "~2.8|3.0.*",
            "symfony/process": "~2.8|3.0.*",
            "symfony/security": "~2.8|3.0.*",
            "symfony/translation": "3.1.*",
            "symfony/twig-bridge": "~3.1",
            "symfony/validator": "~2.8|3.0.*",
            "doctrine/dbal": "~2.2"
        },
    

    Doctrine and Web Profiler working fine.

    Adding CRUDlex:

            "philiplb/crudlex": "0.10.x-dev"
    

    Instanciating the MySQLDataFactory, ServiceProvider: OK

    Mounting the ControllerProvider results in this error:

    InvalidArgumentException in Container.php line 233:
    Identifier "twig.loader.filesystem" does not contain an object definition.
    

    I've tried to tweak the Twig instanciation, with no result. However when I comment the Web Profiler instanciation:

    $app->register(new WebProfilerServiceProvider(), array(
        'profiler.cache_dir' => __DIR__.'/../var/cache/profiler',
    ));
    

    Then the error disappears and I can use CRUDlex.

    So, it looks like issue #41 is back with the latest version.

    Any idea?

    Reviewed by germain-italic at 2016-09-07 02:31
  • 2. Group entities in the navigation Bar

    Hi

    The idea is to allow to group multiple entities into one option of the menu, this is helpful when there are too many entities or want to group based on relation. There is a example of the result:

    navbargroup example
    Reviewed by dmaciel at 2017-04-17 10:35
  • 3. Remove filters and listfields from description example

    In the description feature example (first feature explained in Extended Features) are also other features that are explained later. At first sight is confusing to concentrate in the new feature example because the other two are above the new one, so it forces to read again the text.

    Reviewed by dmaciel at 2017-04-03 13:14
  • 4. 0.9.9 broken with silex/web-profiler ^1.0

    First of all your congratulations for putting up CRUDlex!

    CRUDlexSample deploys v.0.9.7 of ou the box. Adding Web Profiler works well also:

        "require": {
            "philiplb/crudlex": "0.9.7",
            "silex/web-profiler": "^1.0"
        }
    

    Unfortunately upgrading to v0.9.9 conflicts with the Web Profiler:

    Twig_Error_Syntax in ExpressionParser.php line 604:
    Unknown "trans" filter in "@crud/list.twig" at line 22.
    

    Downgrade to v0.9.8:

    Twig_Error_Syntax in ExpressionParser.php line 604:
    Unknown "trans" filter in "@crud/list.twig" at line 14.
    

    Removing silex/web-profiler (v1.0.8) restores CRUDlex v0.9.8 - v0.9.9

    Any hints?

    Reviewed by germain-italic at 2016-02-29 01:14
  • 5. Failed MimeType for stylesheets and JS since 0.12.0 ver.

    Since CRUDlex version 0.12.0 all static files (css,js,...) - get mimetype "text/plain" and GoogleChrome/Firefox show warnings in console. Apache mimetypes - is ok, PHP fileinfo extension - installed. Screenshot ver. 0.12.0 Screenshot ver. 0.11.0 How can I resolve this bug to use CRUDlex with valid CSS and JS? Thank you very much! P.S. Sorry for my english)

    Reviewed by stingmu at 2017-09-02 22:39
  • 6. Exception InvalidArgumentException : Identifier "twig.loader.filesystem" does not contain an object definition.

    Hi, I wanted to try CRUDlex, installed it, made the params in app.php.

    When I add the line $app->mount('/crud', new CRUDlex\ControllerProvider()); is raises the exception

    I tried with CRUDlex 0.11 and 0.12, I made my projet up to date and maybe CRUDlex is not compatible with Symfony 3. Here is my composer.json for information

    { "name": "fabpot/silex-skeleton", "description": "A pre-configured skeleton for the Silex microframework", "license": "MIT", "type": "project", "require": { "php": ">=5.5.9", "silex/silex": "~2.0", "silex/web-profiler": "~2.0", "symfony/asset": "~2.8|^3.0", "symfony/browser-kit": "~2.8|^3.0", "symfony/class-loader": "~2.8|^3.0", "symfony/config": "~2.8|^3.0", "symfony/console": "~2.8|^3.0", "symfony/css-selector": "~2.8|^3.0", "symfony/security-csrf": "^3.2", "symfony/dom-crawler": "~2.3", "symfony/debug": "~2.8|^3.0", "symfony/filesystem": "~2.3", "symfony/finder": "~2.8|^3.0", "symfony/form": "~2.8|^3.0", "symfony/monolog-bridge": "~2.8|^3.0", "symfony/process": "~2.8|^3.0", "symfony/security": "~2.8|^3.0", "symfony/serializer": "~2.3", "symfony/translation": "~2.8|^3.0", "symfony/twig-bridge": "~2.8|^3.0", "symfony/validator": "~2.8|^3.0", "doctrine/dbal": "~2.2", "swiftmailer/swiftmailer": "5.*", "twig/extensions": "^1.2", "symfony/http-kernel": "^3.3", "philiplb/crudlex": "0.12.x-dev" }, "autoload": { "psr-0": { "": "src/", "MyProject": "src/" } }, "extra": { "branch-alias": { "dev-master": "2.0.x-dev" } } } Thanks for the help

    Reviewed by ghost at 2017-06-01 10:07
  • 7. Add attribute hideId for type=reference|many

    On a project that I worked on with my co-workers it made sense to display a reference or list of many references as tags

    This PR add an option to crud.yml that backports this change

    Normal behavior:

    image

    With hideId: true

    image

    Reviewed by jmfayard at 2017-04-05 15:49
  • 8. Array to String error when filtering by reference type and navigating to next page

    Let's say I have a table produit and one field in the table is a reference to another table client.

    On the productList page, I filter by the client_id field. The result gives me 2 pages. If I navigate to the page 2, the error occurs.

    This the DBALException message:

    An exception occurred while executing 'SELECT COUNT(id) FROM `produit` `produit` WHERE (`id_client` = ?) AND (deleted_at IS NULL)' with params [{"id":<UUID>"}]:
    
    Notice: Array to string conversion
    

    The URL of the page: crud/produit?crudPage=1&crudSortField=created_at&crudSortAscending=true&crudFilterid_client%5Bid%5D=<UUID>

    Reviewed by planeth44 at 2018-08-30 12:41
  • 9. Is it possible to chain middleware ?

    As described in Silex documentation, there's a finish middleware that can execute tasks after the Response has been sent to the client. How could we do it for a particular route? Say for example: /crud/myTable/update/xxx

    Reviewed by planeth44 at 2017-05-09 08:55
  • 10. pushEvents + database access

    This is somehow related to Issue #44.

    I would also like to fill a field in the database from inside a pushEvents.

    I have made some tests in a separate controller and succeeded to access the database by invoking $data = $app['crud']->getData($entity); and then using CRUDlex's setters.

    However when trying to do it from inside my pushEvents function, I can't access the $app object. Is there any recommended way to to use the API's functions inside a pushEvents callback?

    Sample code tryings and error:

    $xls2json = function(CRUDlex\CRUDEntity $entity) {
        global $app;
        $data = $app['crud']->getData($entity);
    ...
    $app['crud']->getData('imports')->pushEvent('after', 'create', $xls2json);
    

    or

    $xls2json = function(CRUDlex\CRUDEntity $entity) use ($app) {
        $data = $app['crud']->getData($entity);
    ...
    $app['crud']->getData('imports')->pushEvent('after', 'create', $xls2json);
    

    both lead to:

    ContextErrorException in CRUDServiceProvider.php line 289:
    Warning: array_key_exists(): The first argument should be either a string or an integer
    
    Reviewed by germain-italic at 2016-03-02 20:01
  • 11. Broken events

    Well, broken or I don't know how to use them. Test from a fresh project sample both in v0.9.9 and v0.9.x-dev, I added this on line 38:

    New syntax:

    $app['crud']->getData('library')->pushEvent('before', 'create', function(Entity $entity) {
        // Do something with the entity which is about to be saved.
        return true;
    });
    

    Generates:

    Catchable fatal error: Argument 1 passed to {closure}() must be an instance of Entity, instance of CRUDlex\Entity given, called in /CRUDlexSample-master/vendor/philiplb/crudlex/src/CRUDlex/Data.php on line 104 and defined in //CRUDlexSample-master/web/index.php on line 39
    

    Old syntax:

    $app['crud']->getData('library')->pushEvent('before', 'create', function(CRUDEntity $entity) {
        // Do something with the entity which is about to be saved.
        return true;
    });
    

    Generates:

    Catchable fatal error: Argument 1 passed to {closure}() must be an instance of CRUDEntity, instance of CRUDlex\Entity given, called in //CRUDlexSample-master/vendor/philiplb/crudlex/src/CRUDlex/Data.php on line 104 and defined in /CRUDlexSample-master/web/index.php on line 40
    
    Reviewed by germain-italic at 2016-02-29 22:54
  • 12. [email protected] $default parameter should not be null

    when you submit a form and fields are not required –if the type is text– the values are an empty string. the getField function replace these empty string value by a null value which breaks the SQL schema of NOT NULL if the definition is VARCHAR

    Reviewed by planeth44 at 2018-07-03 09:27
  • 13. New Type: referenced

    Allow an entity to be referenced by many others. The other way round of the reference type. It will use the same UI elements as a many-to-many relationship.

    Reviewed by philiplb at 2016-08-30 19:39
:lipstick: Scalable and durable all-purpose data import library for publishing APIs and SDKs.
:lipstick: Scalable and durable all-purpose data import library for publishing APIs and SDKs.

Porter Scalable and durable data imports for publishing and consuming APIs Porter is the all-purpose PHP data importer. She fetches data from anywhere

May 26, 2022
Library for (de-)serializing data of any complexity (supports JSON, and XML)

jms/serializer Introduction This library allows you to (de-)serialize data of any complexity. Currently, it supports XML and JSON. It also provides yo

May 19, 2022
A repository with implementations of different data structures and algorithms using PHP

PHP Data Structures and Algorithms Data structure and Algorithm is always important for any programming language. PHP, being one of the most popular l

May 17, 2022
Leetcode for PHP, five questions a week and weekends are updated irregularly
Leetcode for PHP,  five questions a week and weekends are updated irregularly

✏️ Leetcode for PHP why do you have to sleep for a long time ,and naturally sleep after death 联系 说明 由于目前工作主要是 golang,我又新起了一个LeetCode-Go-Week项目,- Leetc

May 26, 2022
True asynchronous PHP I/O and HTTP without frameworks, extensions, or annoying code. Uses the accepted Fibers RFC to be implemented into PHP 8.1
True asynchronous PHP I/O and HTTP without frameworks, extensions, or annoying code. Uses the accepted Fibers RFC to be implemented into PHP 8.1

PHP Fibers - Async Examples Without External Dependencies True asynchronous PHP I/O and HTTP without frameworks, extensions, or annoying code behemoth

May 13, 2022
World countries in JSON, CSV, XML and Yaml. Any help is welcome!

World countries in JSON, CSV, XML and YAML. Countries data This repository contains a list of world countries, as defined by ISO Standard 3166-1, in J

May 26, 2022
Silex Skeleton - a fully-functional Silex application that you can use as the skeleton for your new applications

Silex Skeleton - a fully-functional Silex application that you can use as the skeleton for your new applications

Apr 28, 2022
Use auto generated UUID slugs to identify and retrieve your Eloquent models.

Laravel Eloquent UUID slug Summary About Features Requirements Installation Examples Compatibility table Alternatives Tests About By default, when get

Apr 4, 2022
Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless development of your applications.
Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless development of your applications.

Laravel CRUD Generator This Generator package provides various generators like CRUD, API, Controller, Model, Migration, View for your painless develop

May 8, 2022
Auto-generated Interface and Repository file via Repository pattern in Laravel

Auto-generated Repository Pattern in Laravel A repository is a separation between a domain and a persistent layer. The repository provides a collectio

Feb 14, 2022
Plugin for WordPress Full Site Editing That Sets Smart CSS defaults & Removes Auto generated classes.

WazFrame Enhanced This plugin removes autogenerated classes from WordPress that comes from theme layout support for contentSize and wideSize in theme.

Feb 15, 2022
LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.
LaraAdmin is a Open source Laravel Admin Panel / CMS which can be used as Admin Backend, Data Management Tool or CRM boilerplate for Laravel with features like Advanced CRUD Generation, Module Manager, Backups and many more.

LaraAdmin 1.0 LaraAdmin is a Open source CRM for quick-start Admin based applications with features like Advanced CRUD Generation, Schema Manager and

May 24, 2022
A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.
A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.

Lychee A great looking and easy-to-use photo-management-system. Since the 1st of April 2018 this project has moved to it's own Organisation (https://g

May 26, 2022
A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.
A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.

Lychee A great looking and easy-to-use photo-management-system. Since the 1st of April 2018 this project has moved to it's own Organisation (https://g

May 22, 2022
A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.
 A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.

A great looking and easy-to-use photo-management-system you can run on your server, to manage and share photos.

May 24, 2022
Bolt is a simple CMS written in PHP. It is based on Silex and Symfony components, uses Twig and either SQLite, MySQL or PostgreSQL.

⚠️ Note - Not the latest version This is the repository for Bolt 3. Please know that Bolt 5 has been released. If you are starting a new project, plea

May 24, 2022
Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.

cocur/slugify Converts a string into a slug. Developed by Florian Eckerstorfer in Vienna, Europe with the help of many great contributors. Features Re

May 20, 2022
Until 2018, Backpack v3 used this Base package to offer admin authentication and a blank admin panel using AdminLTE. Backpack v4 no longer uses this package, they're now built-in - use Backpack/CRUD instead.
Until 2018, Backpack v3 used this Base package to offer admin authentication and a blank admin panel using AdminLTE. Backpack v4 no longer uses this package, they're now built-in - use Backpack/CRUD instead.

Note: This package is only used by Backpack v3. Starting with Backpack v4, everything this package does is included in Backpack/CRUD - one package to

Apr 28, 2022
CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline styles. This is very usefull when you're sending emails.

CssToInlineStyles class Installation CssToInlineStyles is a class that enables you to convert HTML-pages/files into HTML-pages/files with inline style

May 18, 2022