Download the PHP package jmf/crud-engine-bundle without Composer

On this page you can find all versions of the php package jmf/crud-engine-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package crud-engine-bundle

jmf/crud-engine-bundle

A Symfony bundle that automates CRUD (Create, Read, Update, Delete) controllers and routes for Doctrine entities based on configuration, eliminating repetitive boilerplate code.

Requirements

Installation

Register the bundle in config/bundles.php if not using Symfony Flex:

Quick Start

1. Configure the bundle

Create config/packages/jmf_crud_engine.yaml:

2. Load the routes

In config/routes.yaml:

3. Create templates (optional)

Out of the box, any action whose template is missing renders a built-in bare template, so the bundle works immediately. To customize a view, create a Twig template at the configured path (e.g., templates/article/index.html.twig, templates/article/create.html.twig, etc.) and it takes precedence automatically.

Prefer to fail loudly instead of falling back? Set schema.view.fallback: fail (see Missing templates).

That's it: the bundle automatically registers routes and wires up controllers for all configured actions.

Actions

The bundle provides five actions, each mapped to a controller:

Action Default Route Path HTTP Methods Form Description
index /articles GET No Lists all entities
read /articles/{id} GET No Displays a single entity
create /articles/new GET, POST Yes Creates a new entity
update /articles/{id}/edit GET, POST Yes Updates an existing entity
delete /articles/{id}/delete GET, POST No Deletes an entity (POST confirms)

Route paths and names are derived from the entity class name by default and can be overridden via configuration.

Configuration Reference

Template Placeholders

Configuration values and default patterns support the following placeholders:

Examples use the entity App\Entity\BlogPost: a two-word name, so the casing and pluralization differences are actually visible (with a single-word entity like Article they'd all look the same):

Placeholder Example (BlogPost) Description
{{ EntityKey }} BlogPost Entity name, PascalCase
{{ EntityKeys }} BlogPosts Entity name, pluralized
{{ entityKey }} blogPost Entity name, camelCase
{{ entityKeys }} blogPosts camelCase, pluralized
{{ entity_key }} blog_post Entity name, snake_case
{{ entity_keys }} blog_posts snake_case, pluralized
{{ entitydashkey }} blog-post Entity name, kebab-case
{{ entitydashkeys }} blog-posts kebab-case, pluralized (used in URLs)
{{ ActionKey }} Create Action name, PascalCase
{{ actionKey }} create Action name, camelCase
{{ action_key }} create Action name, snake_case

(Actions are always single words: index, read, create, update, delete, so their case variants only differ in capitalization; the actionKeys/actiondashkey/… variants exist for symmetry with the entity keys.)

Overriding placeholders (schema.keys)

These placeholders are not hard-coded: they are themselves defined as Twig patterns under schema.keys, and you can override them or add your own:

The contract:

The runtime placeholder {{ _entity.id }} used in redirection.parameters is not a key: it is resolved later, per request, against the actual entity, so it is unavailable in key/pattern definitions.

Per-entity configuration files (paths)

Instead of listing every entity under entities, you can keep one file per entity in a directory. Each file holds just the entity body (the actions: block); the entity FQCN is derived from the filename prefixed by a base namespace, so there is no jmf_crud_engine: / entities: / App\Entity\X: wrapper to repeat.

By default, this is enabled with zero configuration: the bundle loads <config-dir>/packages/<bundle-alias>/ (i.e. config/packages/jmf_crud_engine/) with the base namespace App\Entity. Just drop files in:

The filename (without .yaml) is appended to the namespace, so Article.yamlApp\Entity\Article. Subdirectories map to sub-namespaces (Blog/Post.yamlApp\Entity\Blog\Post).

Customizing the directories

Override paths to point elsewhere or to scan several directories (each with its own base namespace). A leading empty namespace makes the directory layout mirror the full FQCN (App/Entity/Article.yaml).

Setting paths explicitly replaces the default. paths and inline entities can be used together, but a given entity class must be defined in exactly one place: declaring it both via a file and inline (or across two scanned directories) throws CrudEngineDuplicateEntityException at container build time.

Notes

Action Helpers

Action helpers allow you to customize behavior at specific lifecycle hooks without replacing the entire controller. Create a class extending the matching *ActionHelperBase and register it as a Symfony service. Each base implements the full interface with sensible defaults (the same behavior the bundle uses when no helper is configured), so you override only the hooks you actually need.

If the class name matches a configured default pattern (e.g., App\Controller\Article\CreateActionHelper), it is picked up automatically. Otherwise, set helper explicitly in the action configuration.

The configuration (route names/paths, form type and helper auto-discovery, view paths, etc.) is resolved once, at container build time, and cached in the compiled container. As with routes, adding a helper/form-type class that matches a discovery pattern requires a container rebuild (cache:clear) to be picked up.

Create Helper

The base also provides persist() (Doctrine persist + flush) and hookAfterPersist(). Override them only to change persistence or run post-save side effects.

Update Helper

Same hooks as the create helper, minus createEntity (the entity already exists). The default persist() here only flushes the already-managed entity; hookAfterPersist() is also available for post-save side effects.

Index Helper

Read Helper

Delete Helper

The base also provides remove() (Doctrine remove + flush), hookAfterRemove(), and onFailure() (re-throws the failure). Override them as needed.

Templates

Templates receive the entity (or collection) as a variable. The variable name is derived from the entity key (e.g., article for App\Entity\Article, articles for the index action).

Forms are passed as form (a FormView instance).

Example: templates/article/index.html.twig

Example: templates/article/create.html.twig

Missing templates

When the resolved template for an action does not exist, the behavior is controlled by schema.view.fallback:

Value Behavior
provide (default) Renders the bundle's built-in bare template (@JmfCrudEngine/{action}.html.twig).
fail Throws CrudEngineMissingViewException.

The built-in templates are intentionally minimal: they exist to get pages rendering immediately and to be overridden. Providing your own template at the configured path always takes precedence over the built-in one.

Missing form types

For create/update, when no form type is configured (form.type) or discovered (via the schema.form.type patterns), the behavior is controlled by schema.form.fallback:

Value Behavior
provide (default) Builds a generic form from the entity's Doctrine metadata (CrudEngineEntityType).
fail Throws CrudEngineMissingConfigurationException.

The generic form is a scaffold to be overridden: it maps scalar columns and enumType fields, and renders to-one associations as a choice of related entities; it skips identifiers, embeddables, to-many associations, and unmappable column types. Configuring or discovering a real form type always takes precedence.

To make the fallback visible wherever it renders (including under a custom template), the generated form prepends a disabled, read-only "Generated fallback form" field naming the form type class to implement to replace it.

License

MIT


All versions of crud-engine-bundle with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
doctrine/instantiator Version ^2.0
doctrine/orm Version ^3.0
jmf/template-rendering Version ^1.0|^2.0
symfony/doctrine-bridge Version ^7.0|^8.0
symfony/finder Version ^7.0|^8.0
symfony/form Version ^7.0|^8.0
symfony/framework-bundle Version ^7.0|^8.0
symfony/http-foundation Version ^7.0|^8.0
symfony/routing Version ^7.0|^8.0
symfony/security-bundle Version ^7.0|^8.0
symfony/yaml Version ^7.0|^8.0
twig/extra-bundle Version ^3.0
twig/string-extra Version ^3.0
webmozart/assert Version ^1.0|^2.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package jmf/crud-engine-bundle contains the following files

Loading the files please wait ...