PHPackages                             adamwojs/ezplatform-location-reference - 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. adamwojs/ezplatform-location-reference

ActiveEzplatform-bundle

adamwojs/ezplatform-location-reference
======================================

eZ Platform Location Reference

v0.2.0(6y ago)03MITPHPPHP ^7.3

Since Aug 14Pushed 6y agoCompare

[ Source](https://github.com/adamwojs/ezplatform-location-reference)[ Packagist](https://packagist.org/packages/adamwojs/ezplatform-location-reference)[ RSS](/packages/adamwojs-ezplatform-location-reference/feed)WikiDiscussions master Synced today

READMEChangelog (2)Dependencies (4)Versions (3)Used By (0)

ezplatform-location-reference
=============================

[](#ezplatform-location-reference)

Problem
-------

[](#problem)

The common case in the eZ Platform configuration is referencing to some location, usually using Location ID e.g.

- Content root for Site Access ([https://doc.ezplatform.com/en/latest/guide/multisite/#location\_id](https://doc.ezplatform.com/en/latest/guide/multisite/#location_id))
- Folder used to store Image Assets ([https://doc.ezplatform.com/en/latest/api/field\_type\_reference/#configuration](https://doc.ezplatform.com/en/latest/api/field_type_reference/#configuration))

There are several issues in this approaches:

- Location IDs differ between environments
- Using [Magic numbers](https://en.wikipedia.org/wiki/Magic_number_%28programming%29) is a [code smell](https://en.wikipedia.org/wiki/Code_smell)

This package introduces [Domain Specific Language](https://en.wikipedia.org/wiki/Domain-specific_language), based on Symfony [Expression Language](https://symfony.com/doc/current/components/expression_language.html) component, allowing to refer locations using meaningful and descriptive expressions.

Usage
-----

[](#usage)

### Resolve location references

[](#resolve-location-references)

Location reference expressions could be resolved using `LocationReferenceResolver` e.g.

```
