locomotivemtl/charcoal-contrib-property-filter

使用模型属性作为筛选条件的收集筛选小部件的Charcoal服务提供商。

0.1.2.1 2020-01-21 20:08 UTC

This package is auto-updated.

Last update: 2024-09-23 00:43:08 UTC


README

License Latest Stable Version Code Quality Coverage Status Build Status

A Charcoal service provider with my cool feature.

目录

安装

首选(也是唯一支持)的方法是使用Composer

$ composer require locomotivemtl/charcoal-contrib-property-filter

依赖

要求

配置

在项目的配置文件中包含 property-filter 模块。这将提供 charcoal-contrib-property-filter 正常工作所需的一切,无需 metadata/views/action/routes 路径等。

{
    "modules": {
       "charcoal/property-filter/property-filter": {}
    }
}

用法

charcoal-contrib-property-filter 可以用作仪表盘小部件来筛选模板中包含的所有可筛选小部件。在仪表盘小部件中定义如下结构 👇 以创建筛选条件。

{
    "filters": {
        "type": "charcoal/property-filter/widget/property-filter",
        "property_filters": [
            "taxonomy_1",
            "taxonomy_2",
            "taxonomy_3"
        ],
        "properties_options": {
            "taxonomy_1": {
                "required": false,
                "multiple": true,
                "input_type": "charcoal/admin/property/input/select"
            },
            "taxonomy_2": {
                "required": false,
                "input_type": "charcoal/admin/property/input/radio"
            },
            "taxonomy_3": {
                "required": false,
                "input_type": "charcoal/admin/property/input/checkbox"
            }
        },
        "layout": {
            "structure": [
                {"columns": [1, 1, 1]}
            ]
        }
    }
}

选项

开发

要安装开发环境

$ composer install

运行脚本(phplint、phpcs 和 phpunit)

$ composer test

资产

安装资产构建环境

$ yarn insall

运行构建脚本

$ grunt watch

或者

$ grunt

API 文档

开发依赖

  • [php-coveralls/php-coveralls][phpcov]
  • [phpunit/phpunit][phpunit]
  • [squizlabs/php_codesniffer][phpcs]

编码风格

charcoal-contrib-property-filter 模块遵循 Charcoal 编码风格

可以使用 composer phpcs 执行编码风格验证/强制执行。还可以使用 composer phpcbf 使用自动修复器。

致谢

许可

Charcoal 根据 MIT 许可证授权。有关详细信息,请参阅 LICENSE