carlcs/craft-elementstats 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

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

carlcs/craft-elementstats

Composer 安装命令:

composer require carlcs/craft-elementstats

包简介

Element Stats widget for Craft CMS

README 文档

README

Element Stats

Installation

The plugin is available on Packagist and can be installed using Composer. You can also download the latest release and copy the files into craft/plugins/elementstats/.

$ composer require carlcs/craft-elementstats

Configuration

To configure the plugin you need to create a file named elementstats.php in the craft/config/ folder. This is where you configure the stats available in your widgets.

Place all of your stats configurations in a nested array with the key stats. The configurations themselves have to be arrays with an unique array key which will be used to identify the stat. Within that array you can use the following stat config settings:

  • name – What the stat will be called in the widget.
  • link – Where the link in your widget will lead. The setting expects a Control Panel URI.
  • elementType – What element type to fetch elements.
  • criteria – An array of element criteria parameters used to filter the elements.
  • dateColumn – What database column should be used for the time axis in the chart.
  • total – Allows you to manually set the value returned to the widgets.
  • numberFormat – How the value should be formatted in the widgets.

Element Stats widget comes with an example configuration file to give you a better idea of what types of data you can use and how to configure the stats configurations.

Here’s a very basic example:

return [
    'stats' => [
        'all-entries' => [
            'name'        => 'All Entries',
            'link'        => 'entries',
            'elementType' => 'Entry',
        ],
        'sports-news' => [
            'name'        => 'Sports News',
            'link'        => 'entries/news',
            'elementType' => 'Entry',
            'criteria'    => [
                'section' => 'news',
                'type'    => 'sports',
            ],
        ],
    ],
];

Requirements

  • PHP 5.4 or later
  • Craft CMS 2.6 or later

统计信息

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

GitHub 信息

  • Stars: 14
  • Watchers: 2
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2016-07-21

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固