PHPackages                             se7enxweb/explayouts-core - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. se7enxweb/explayouts-core

ActiveEzpublish-legacy-extension

se7enxweb/explayouts-core
=========================

Core domain layer for the Netgen Layouts port to Exponential CMS.

10PHP

Since Jul 31Pushed yesterdayCompare

[ Source](https://github.com/se7enxweb/explayouts_core)[ Packagist](https://packagist.org/packages/se7enxweb/explayouts-core)[ RSS](/packages/se7enxweb-explayouts-core/feed)WikiDiscussions main Synced today

READMEChangelogDependenciesVersions (1)Used By (0)

Exponential Layouts Core
========================

[](#exponential-layouts-core)

General description
-------------------

[](#general-description)

Exponential Layouts Core (`explayouts_core`) is the core domain service layer of the Exponential Layouts suite for Exponential 6 / Exponential Legacy. It wraps the persistent value objects owned by the `explayouts` extension (`expLayoutsLayout`, `expLayoutsZone`, `expLayoutsBlock`, `expLayoutsCollection`, `expLayoutsRule`, ...) in small service classes with a create/load/update/delete API, so admin modules and the JSON API do not have to talk to `eZPersistentObject` directly.

It is an Exponential Legacy port inspired by the `netgen/layouts-core` package. The services are intentionally thin: they use the Exponential Legacy environment (database, cache, permissions) rather than the Doctrine/Symfony stack of the upstream package.

This extension provides the following capabilities:

- Layout services - Create, load, list, update, publish, copy and delete layouts, including draft/published handling and lookup by identifier or layout type.
- Zone services - Create, load, update and delete zones per layout, count their blocks and link a zone to a shared layout (zone linking).
- Block services - Create, load, update, move and delete blocks, set their parameters and attach collections.
- Collection services - Manage block collections and their items: add, load, update, remove and replace items in one call.
- Rule services - Manage layout mapping rules: create, list, copy, enable/disable, delete and replace their targets and conditions.
- Stable programmatic API - One intended public API surface for every consumer (admin modules, JSON API, CLI scripts, your own integrations) instead of raw persistence calls.

Features
--------

[](#features)

The following features are provided by the Exponential Layouts Core extension:

- Five focused service classes - Each service covers one aggregate of the layouts domain and exposes plain PHP methods with predictable signatures; all services are instantiated directly with `new` and carry no global state.
- Draft/published awareness - Layout methods distinguish drafts (`status` 1) and published rows (`status` 2): `loadDraft()`, `loadPublished()`, `publish()`, and optional status filters on the list methods.
- Zone linking - `expLayoutsCoreZoneService::setLinkedLayout()` links a zone to a shared layout, the mechanism behind reusable shared zones.
- Whole-list item replacement - `expLayoutsCoreCollectionService::setItems()` replaces a collection's items in one call (item values are node ids), the operation the SPA editor uses when saving manual collections.
- Target/condition replacement - `expLayoutsCoreRuleService::setTargets()` and `setConditions()` accept arrays of `type`/`value` hashes and replace the existing sets atomically.
- No configuration of its own - The extension ships no INI files, modules or templates; it contains only the five service classes plus an `autoloads/explayouts_core_autoload.php` class map. All domain configuration (block definitions, layout types, resolver fallback) stays in `explayouts.ini` of the `explayouts` extension.
- Proven consumers - The services power `extension/explayouts_ui/modules/explayouts_ui/` (`layout_list.php`, `rule_list.php`, `rule_edit.php`), the `explayouts_ui_api` JSON API dispatcher and module views, and `extension/explayouts/bin/php/layout_info.php`.
- Subclass-friendly - Services are created with `new` at each call site, so behavior can be changed by subclassing in your own extension without any global replacement mechanism.

Version
-------

[](#version)

- The current version of Exponential Layouts Core is 1.0.0
- Last Major update: July 30, 2026

Copyright
---------

[](#copyright)

- Exponential Layouts Core is copyright 1998 - 2026 7x
- See: [LICENSE.md](LICENSE.md) for more information on the terms of the copyright and license

License
-------

[](#license)

Exponential Layouts Core is licensed under the GNU General Public License.

The complete license agreement is included in the [LICENSE.md](LICENSE.md) file.

Exponential Layouts Core is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 2 of the License or at your option a later version.

Exponential Layouts Core is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

The GNU GPL gives you the right to use, modify and redistribute Exponential Layouts Core under certain conditions. The GNU GPL license is distributed with the software, see the file LICENSE.md.

It is also available at

You should have received a copy of the GNU General Public License along with Exponential Layouts Core in LICENSE.md. If not, see .

Using Exponential Layouts Core under the terms of the GNU GPL is free (as in freedom).

For more information or questions please contact

Requirements
------------

[](#requirements)

The following requirements exists for using the Exponential Layouts Core extension:

Exponential version

- Make sure you use Exponential 6 / eZ Publish Legacy (required) or higher.

PHP version

- Make sure you have PHP 8.1 or higher.

Sibling extensions

- Required: `extension/explayouts` installed with its `explayouts_*` database schema — this extension only provides services on top of it (value objects and database tables).
- Consumed by: `explayouts_ui` and `explayouts_ui_api` — activate `explayouts_core` before either of them.

Installation
------------

[](#installation)

In short: place the extension in `extension/explayouts_core`, activate it via `site.ini` `[ExtensionSettings] ActiveExtensions[]` (or per siteaccess via `ActiveAccessExtensions[]`), then regenerate autoloads and clear all caches. The extension ships no INI settings of its own — it contains only the five service classes plus an `autoloads/explayouts_core_autoload.php` class map.

See [INSTALL.md](INSTALL.md) for the full step-by-step installation instructions.

Usage
-----

[](#usage)

All services are plain classes; instantiate them directly.

ClassPurpose`expLayoutsCoreLayoutService``load`, `loadDraft`, `loadPublished`, `listAll`, `create`, `update`, `publish`, `copy`, `delete`, `loadByIdentifier`, `listByType``expLayoutsCoreZoneService``load`, `loadByLayout`, `create`, `update`, `delete`, `countBlocks`, `setLinkedLayout``expLayoutsCoreBlockService``load`, `loadByZone`, `create`, `update`, `move`, `delete`, `setParameters`, `setCollection``expLayoutsCoreCollectionService``load`, `loadByBlock`, `create`, `update`, `delete`, `addItem`, `removeItem`, `loadItems`, `updateItem`, `setItems``expLayoutsCoreRuleService``load`, `listAll`, `create`, `update`, `setTargets`, `setConditions`, `copy`, `delete`, `listByLayout`, `enable`, `disable`A minimal example creating and publishing a layout with one block:

```
