Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/elbformat/field-helper-bundle
This bundle provides helpers to extract and set structured data from and to ibexa content fields
https://github.com/elbformat/field-helper-bundle
ezplatform ibexa ibexa-bundle ibexa-platform ibexadxp
Last synced: about 1 month ago
JSON representation
This bundle provides helpers to extract and set structured data from and to ibexa content fields
- Host: GitHub
- URL: https://github.com/elbformat/field-helper-bundle
- Owner: elbformat
- License: mit
- Created: 2021-11-17T13:15:39.000Z (about 3 years ago)
- Default Branch: main
- Last Pushed: 2024-04-13T20:58:25.000Z (9 months ago)
- Last Synced: 2024-04-14T11:00:16.039Z (9 months ago)
- Topics: ezplatform, ibexa, ibexa-bundle, ibexa-platform, ibexadxp
- Language: PHP
- Homepage:
- Size: 193 KB
- Stars: 8
- Watchers: 4
- Forks: 1
- Open Issues: 14
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[![CircleCI](https://circleci.com/gh/elbformat/field-helper-bundle/tree/main.svg?style=svg)](https://circleci.com/gh/elbformat/field-helper-bundle/tree/main)
[![codecov](https://codecov.io/gh/elbformat/field-helper-bundle/branch/main/graph/badge.svg?token=TQATH67HKN)](https://codecov.io/gh/elbformat/field-helper-bundle)
[![License Badge](https://img.shields.io/github/license/datengaertnerei/test-data-service.svg)](https://mit-license.org/)# Elbformat Field Helper Bundle for ibexa DXP
This bundle provides helpers to extract and set structured data from and to ibexa content fields.What are "Field helpers"?
=========================
Field helpers are intended to easily and safely access fields from content objects in a typed manner.
With this you can make your project safe for static code analysis without adding too much boilerplate code everywhere.
Especially for importer scripts, that create content, there is an update method which helps you to track changes.
With thism, you can speed up the update process by not publishing it, when no change was made at all.Quick usage
===========
Install bundle via composer
```console
$ composer require elbformat/field-helper-bundle
```
Use like this
```php
public function getFields(RegistryInterface $fieldHelperRegistry, Content $content) {
$myText = $fieldHelperRegistry->getTextFieldHelper()->getString($content, 'text_field');
$linkObject = $fieldHelperRegistry->getLinkFieldHelper()->getLink($content, 'my_url');
$linkUrl = $linkObj->getUrl();
$linkText = $linkObj->getText();
}
```Further topics
==============
* [Installation](docs/installation.md)
* [Changelog](docs/changelog.md)
* [How to use the field helpers](docs/usage.md)
* [List of supported fields and their helpers](docs/fields.md)
* [Extending existing helpers](docs/extending.md)
* [Writing your own helpers](docs/own_helper.md)
* [Running tests locally](docs/testing.md)