Weave Code
Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Ace Sonata Doctrine Orm Admin Bundle Laravel Package

ns/ace-sonata-doctrine-orm-admin-bundle

A Symfony bundle that integrates Sonata Admin with Doctrine ORM, providing admin interfaces for managing Doctrine-backed entities. It connects ORM mappings and persistence to Sonata’s admin framework to simplify CRUD administration in Symfony applications.

View on GitHub
Deep Wiki
Context7

Getting Started

This bundle is a thin Twig-template override layer for Sonata Admin’s Doctrine ORM admin, swapping Sonata’s default CRUD/layout markup for the “Ace” admin theme. There is effectively no PHP API surface to learn — your integration work is almost entirely in template config and Twig.

Minimal steps:

  1. Install alongside a working Sonata Admin setup:

    composer require ns/ace-sonata-doctrine-orm-admin-bundle
    

    You must already have sonata-project/admin-bundle and sonata-project/doctrine-orm-admin-bundle installed and configured — this package depends on them and will not bootstrap Sonata for you.

  2. Register the bundle in config/bundles.php (Symfony 4+) or AppKernel::registerBundles():

    return [
        // ... Sonata bundles first
        Ns\AceSonataDoctrineORMAdminBundle\NsAceSonataDoctrineORMAdminBundle::class => ['all' => true],
    ];
    
  3. Point Sonata at the Ace templates in config/packages/sonata_admin.yaml:

    sonata_admin:
        templates:
            layout: '@NsAceSonataDoctrineORMAdminBundle/standard_layout.html.twig'
            edit: '@NsAceSonataDoctrineORMAdminBundle/CRUD/edit.html.twig'
            list: '@NsAceSonataDoctrineORMAdminBundle/CRUD/list.html.twig'
            show: '@NsAceSonataDoctrineORMAdminBundle/CRUD/show.html.twig'
    
  4. Clear cache and open any existing admin. First use case: confirm an existing CRUD screen renders with the Ace layout before you change anything else.

Where to look first: vendor/ns/ace-sonata-doctrine-orm-admin-bundle/Resources/views/ (or templates/ in newer layouts). That directory is the package — the Twig files and the blocks they define are the contract you’ll be extending.

Implementation Patterns

Global theme, per-admin override. Use sonata_admin.templates for the site-wide default, then override per admin class via $admin->setTemplate('edit', '...') or the getTemplate() method when one admin needs different markup. This lets you apply the Ace theme broadly but keep a bespoke screen for one entity.

Extend, don’t replace. The intended pattern is to {% extends '@NsAceSonataDoctrineORMAdminBundle/CRUD/edit.html.twig' %} in your own templates and override individual blocks (typically form, form_actions, tabs, list_footer). Copying a vendor template into your app and editing it locally will silently drift from upstream markup and is the main source of “why did my field rendering change” bugs.

Form theming. If Ace markup affects form rendering, register the bundle’s form theme in twig.yaml (form_themes: ['@NsAceSonataDoctrineORMAdminBundle/Form/...']) so horizontal/vertical field layouts are consistent across CRUD and custom forms.

Per-admin customization workflow. The pragmatic loop is: render the screen, view-source or use Symfony’s Twig profiler, find the block producing the markup, then override that one block in an admin-specific template. Keep overrides shallow — one or two blocks per template.

Integration with your own assets. Ace’s CSS/JS typically needs to be wired into standard_layout.html.twig’s asset blocks or into sonata_admin.templates.layout. If you also run Webpack Encore, override the asset blocks rather than the whole layout so you keep Sonata’s admin JS wiring intact.

Config-driven customization. Prefer Sonata’s own config knobs (sonata_admin.options, dashboard groups, title_logo) over editing layout templates — they survive package upgrades.

Gotchas and Tips

  • Near-zero maintenance signal. 0 stars, 0 dependents, and a score of 0 mean you should treat this as effectively unmaintained. Pin the exact version in composer.json and verify compatibility against your installed Sonata Admin major version before committing to it; Sonata’s template block names and Twig inheritance change between majors.
  • Block names are the API. Upstream Sonata renames and reorganizes blocks across versions. If your override references a block the bundle’s template no longer defines, Twig throws at render time, not at cache warm — so smoke-test list/edit/show after every Sonata upgrade.
  • Version lockstep. Match the bundle’s target Sonata/Symfony generation. Running an old Sonata 3-style template set under Sonata 4/5 is the most common failure and produces confusing partial renders rather than clear errors.
  • Assets aren’t managed. The bundle ships templates, not compiled assets. You’re responsible for publishing/importing the Ace theme’s CSS/JS and for the assets:install step if the templates reference bundles/nsace... paths.
  • Cache clearing is mandatory after changing template config or overriding templates, since Twig caches compiled templates aggressively. Use bin/console cache:clear or set twig.cache: false in dev locally.
  • Don’t assume PHP extension points exist. Since the focus is template overrides, look for a DI extension / bundle class only if you need global config; most customization lives in Twig. If you need behavior (not markup), do it in the Admin class, not here.
  • Debugging tip. Enable the Twig profiler and use {% dump %} inside an overridden block to inspect available variables (admin, form, object, action) — the bundle doesn’t document its template context.
  • Upgrade path. Because the package is unreleased-thin, keep a fork or copy of the templates under your own namespace if you rely on it in production. That converts an abandoned dependency into a template set you fully control, at the cost of tracking Sonata’s upstream changes yourself.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
abbasudo/artisan-route
mirvan/ippanel
ignibyte/aic-framework
glavweb/data-schema-bundle
glavweb/datagrid-bundle
tacticmedia/scim-server
uni-method/frame
neika-ai/sdk
adachsoft/php-code-style
pharaonic/laravel-notification-dependencies
beautinow/translug
dev-brainiac/bot-cloaked
octoberrain/html
octoberrain/extension
octoberrain/exception
octoberrain/contracts
adachsoft/api-version-bundle
cgv/localized-resource
noith/settings
kda/laravel-package