PHP 클래스 CommentStars, ProcessWire

Handles rendering of star ratings for comments. Additional code in comments.js and comments.css accompanies this. Copyright 2015 by Ryan Cramer for ProcessWire
상속: extends WireData
파일 보기 프로젝트 열기: ryancramerdesign/ProcessWire 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
$defaults

공개 메소드들

메소드 설명
__construct ( ) Construct comment stars
render ( integer | float | null $stars, boolean $allowInput = false ) : string Render stars
renderCount ( integer $count, float | integer $stars, string $schema = '' ) : string Render a count of ratings
setDefault ( $key, $value ) Change one of the defaults (see $defaults)

메소드 상세

__construct() 공개 메소드

Construct comment stars
public __construct ( )

render() 공개 메소드

If given a float for $stars, it will render partial stars. If given an int for $stars, it will only render whole stars.
public render ( integer | float | null $stars, boolean $allowInput = false ) : string
$stars integer | float | null Number of stars that are in active state
$allowInput boolean Whether to allow input of stars
리턴 string

renderCount() 공개 메소드

Render a count of ratings
public renderCount ( integer $count, float | integer $stars, string $schema = '' ) : string
$count integer
$stars float | integer
$schema string May be "rdfa" or "microdata" or blank (default) to omit.
리턴 string

setDefault() 공개 정적인 메소드

Example: CommentStars::setDefault('star', '');
public static setDefault ( $key, $value )
$key
$value

프로퍼티 상세

$defaults 보호되어 있는 정적으로 프로퍼티

protected static $defaults