定制 sheadawson/silverstripe-rateable 二次开发

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

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

sheadawson/silverstripe-rateable

Composer 安装命令:

composer require sheadawson/silverstripe-rateable

包简介

An extension that adds a star rating system + UI to any DataObject type.

README 文档

README

An extension that adds a star rating system + UI to any DataObject type

Requirements

Silverstripe 4 and 5

Installation

composer require sheadawson/silverstripe-rateable 2.0.x@stable

Apply the Rateable DataExtension to the Objects you want to rate. ie. in mysite/_config/config.yml

Page:
  extensions:
    - SheaDawson\Rateable\Extensions\Rateable

Then in your templates you can use $RateableUI, when in the context of your rateable object to render the star rating UI. If you have multiple instances of the same DataObject + RateableUI on one page, you can pass in a unique identifier string to $RateableUI, ie. $RateableUI('footer').

Run dev/build?flush=all

Sorting objects by rating

$pages = Page::get();
$sortedPages = singleton('RateableService')->sortByRating($pages);

Disabling by default on some page types

If you have added this extension to the Page class, it's enabled by default on all pages. But on some page types this might be annoying, e.g. ErrorPage or some holders. You can disable $RateableUI by default on this pages by adding this to your config.yml:

ErrorPage:
  defaults:	
    EnableRatings: 0

You can still enable it on some pages of this type by hand in the "Settings" section.

统计信息

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

GitHub 信息

  • Stars: 20
  • Watchers: 7
  • Forks: 13
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2013-11-25

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固