定制 unrealmanu/ez-content-field-filter 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

unrealmanu/ez-content-field-filter

Composer 安装命令:

composer require unrealmanu/ez-content-field-filter

包简介

Filter field of ez Content

README 文档

README

Filter "Content Class -Fields-" with specific value type instance

Instructions

Create new Filters().

 $fieldHelper = new Filters();

Set the Content need to filter fields

  • support only "eZ\Publish\API\Repository\Values\Content\Content"
  • Single $content or Array [$content, $content, $content]
$fieldHelper->setContent($content);

Choose the filter "value class" instance

  • Choose single or multiple instance of class for filtering the content
use eZ\Publish\Core\FieldType\Image\Value as ImageValue;
use eZ\Publish\Core\FieldType\RichText\Value as RichTextValue;
use eZ\Publish\Core\FieldType\TextBlock\Value as TextBlockValue;
use eZ\Publish\Core\FieldType\TextLine\Value as TextLineValue;
  • Single Value::class or [ValueA::class, ValueB::class, ValueC::class]
$fieldHelper->setClass(ImageValue::class);
  • Field name from get value (Required)
$fieldHelper->setValueField('uri');

Example

use unrealmanu\ezFieldIterator\Filters as FieldHelper;

/**
* @return string|null
*/
function myFilter():?string
{
    $fieldHelper = new FieldHelper();
    $fieldHelper->setContent($content);
    $fieldHelper->setClass(ImageValue::class);
    $fieldHelper->setValueField('uri');

    return $fieldHelper->getFirstChildren();
    //return $fieldHelper->getChildren();
}

Real World application

  • Get all images of "contents array" for image-sitemap
  • Get first image/text of "contents array" for search-indexing
  • Get all text field of Content for generate list of Tag/Description etc
  • Use your creativity :)

统计信息

  • 总下载量: 1
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 0
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: mit
  • 更新时间: 2020-03-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固