Karross
Prerequisites
Karross is a Symfony bundle designed to work seamlessly with Doctrine ORM.
- PHP 8.4+
- Composer
- Symfony 7+
Installation
composer require karross/karross-bundle
Note: Symfony Flex should automatically register the bundle in your config/bundles.php:
Karross\KarrossBundle::class => ['all' => true],
Philosophy
Karross aims to work out of the box — no configuration, no boilerplate, no controller code. It automatically handles your Doctrine entities to provide a functional admin interface instantly.
But almost every part of Karross can be customized: the templates, the actions, the routes, and the translations.
Features
- Automatic CRUD routes for your Doctrine entities
- Customizable Twig templates with simple overrides
- Table views that handle nested/embedded entity fields
- Auto-generated translation keys — you just need to provide values
Templates customization
Karross uses a flexible template inheritance system.
Let’s say you have a basic Doctrine entity:
// src/Entity/Article.php
namespace App\Entity;
use Doctrine\ORM\Mapping as ORM;
#[ORM\Entity]
class Article
{
#[ORM\Id]
#[ORM\GeneratedValue]
#[ORM\Column]
private ?int $id = null;
#[ORM\Column(length: 255)]
private ?string $title = null;
#[ORM\Column(type: 'text')]
private ?string $content = null;
// getters and setters...
}
When you install Karross, it automatically exposes routes such as:
/admin/article // List of articles
/admin/article/{id} // A specific article
The list view corresponds to the index action, which comes with a predefined set of templates:
- index.html.twig — the main entry template (its name matches the action)
- items.html.twig — wraps the list of articles
- item.html.twig — handles a single row
- field.html.twig — handles a specific field in a cell
Knowing that, you can override almost anything by creating templates inside your project under templates/bundles/KarrossBundle/:
-
Override the list for a specific entity: entity_article_items.html.twig
-
Override all string fields for an entity: entity_article_type_string_field.html.twig
-
Override a specific field across all entities: field_title_field.html.twig
The naming pattern follows a clear principle — from the most generic to the most specific:
entity_{your_entity} → targets a specific entity type_{a_field_type} → targets a specific field type field_{a_field_name} → targets a specific field
Each pattern ends with the base template name you want to override.
Note that templates have a defined scope. For example, field_title_items.html.twig does not make sense, since items.html.twig has an entity scope.
Therefore, the field_ prefix only applies to field.html.twig. Other prefixes can be used, but always respecting this order of specificity: entity_ → type_ → field_.
Translations
Contribute
Contributions, issues, and feature requests are welcome! If you want to help, just open a PR or issue on GitHub