umbrella2/corebundle
CoreBundle for Umbrella2 supplies foundational services and shared utilities for PHP applications, including configuration, common helpers, and integration points. A lightweight base package for building and extending Umbrella2 projects.
umbrella2/corebundle is the core entity and service layer of the Umbrella CMS, not a standalone library. It only makes sense if you're maintaining an existing Umbrella-based Symfony application (typically pulled in transitively via umbrella2/umbrella).
Minimal steps:
Install the meta-package rather than the core bundle directly, so you also get the dependent bundles (umbrella2/adminbundle, umbrella2/blockbundle, taxonomy/media bundles, etc.):
composer require umbrella2/umbrella
If you must pin it explicitly, note the last tag is 2021-05-31; check composer show umbrella2/corebundle and align with the Symfony version your app is on (4.x era).
Register the bundle in config/bundles.php (or AppKernel::registerBundles() for older skeletons):
Umbrella\CoreBundle\UmbrellaCoreBundle::class => ['all' => true],
Import the routing and enable the config tree. The bundle exposes an extension alias, so a minimal config/packages/umbrella_core.yaml with the defaults is enough — dump the full reference with:
bin/console config:dump-reference umbrella_core
Schema: because the core bundle ships Doctrine mappings for its base entities, run your migrations (or doctrine:schema:validate) after enabling it, and inspect the generated tables before applying.
Where to look first: the bundle's base entities (Node, Term, User/Role, File/Media, Menu) and its service definitions. Those are the two things you'll extend or override 90% of the time. Check Resources/config/ for service wiring and Resources/views/ for the Twig layout blocks you'll inherit.
First use case: fetching a content node by its path and rendering it in a controller:
// controller
$node = $nodeRepository->findOneByPath('/about');
return $this->render('page/show.html.twig', ['node' => $node]);
If that works end-to-end (routing, tree lookup, template), the bundle is wired correctly; everything else is incremental.
Extend the base entities, don't modify the bundle. Umbrella is designed around Doctrine mapped-superclass / single-table inheritance. Put your own App\Entity\Page extends Umbrella\CoreBundle\Entity\Node in src/Entity, register the discriminator, and let the bundle's repositories query through. This is the single most important pattern: keep vendor code pristine.
Work through the container, not new. The core bundle exposes services for the tree, breadcrumbs, node resolution, media handling and menu building. Inject them by their service ID (check bin/console debug:container --show-private | grep umbrella) rather than re-implementing path/tree logic yourself.
Config-driven behavior over code. Most Umbrella features (available node types, menu locations, default templates, upload paths) are toggled in umbrella_core config. Prefer a config change over an event subscriber when you need to enable/disable a feature — the bundle reads config at container compile time in several places.
Override templates via the standard bundle override path. Create templates/bundles/UmbrellaCoreBundle/... with the same relative path as the vendor template. This is safer than editing vendor files and survives composer install.
Integrate through Symfony events, not patching. If your app needs extra behavior on node save/publish, use Doctrine lifecycle listeners on your own entity subclasses, or a kernel.request listener that resolves the current node. The bundle was built pre-messenger, so hook into its service methods by decorating the relevant service (decorates: umbrella_core.<service_id>).
Typical workflow for a content-type addition:
umbrella_core config (or the admin bundle's type registry).bin/console cache:clear) — the bundle caches config and routing aggressively.When integrating into a modern Symfony app: treat the bundle as a black box behind a repository/service facade of your own. Wrap every call to a core service in a thin adapter class so you can later replace it, since the package is archived and won't receive Symfony 6/7 compatibility.
composer path repository) if you need to patch it.composer.json constraints will resolve to outdated Symfony/Doctrine versions. Expect conflicts — resolve by pinning your framework version or by --ignore-platform-reqs in CI only, never locally.umbrella_core.yaml you must cache:clear (or delete var/cache), otherwise behavior silently stays stale — a classic source of "my config change does nothing."@MappedSuperclass semantics from the bundle and never re-map the base class in your config.bundles/... directory. If a Twig block appears missing, check debug:twig for which file actually won.bin/console debug:container | grep umbrella, config:dump-reference umbrella_core, doctrine:schema:validate, debug:router | grep umbrella. In that order.AbstractTypeExtension), Twig extension override, and event subscribers on your own entity subclasses. Avoid overriding the bundle's controllers directly — you'll be stuck at the next (nonexistent) fix.How can I help you explore Laravel packages today?