elbformat/field-helper-bundle
Composer 安装命令:
composer require elbformat/field-helper-bundle
包简介
Provides helpers to extract and set structured data from and to ibexa content fields
关键字:
README 文档
README
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
$ composer require elbformat/field-helper-bundle
Use like this
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
统计信息
- 总下载量: 7.21k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 8
- 点击次数: 1
- 依赖项目数: 1
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2021-11-22