common/components/FormDesigner.php
public function getRatingStars( $config = [] ) {

		$class		= isset( $config[ 'class' ] ) && !empty( $config[ 'class' ] ) ? $config[ 'class' ] : 'cmt-rating';
		$stars		= isset( $config[ 'stars' ] ) ? $config[ 'stars' ] : 5;
		$selected	= isset( $config[ 'selected' ] ) ? $config[ 'selected' ] : 0;
		$disabled	= isset( $config[ 'disabled' ] ) ? $config[ 'disabled' ] : false;
		$readonly	= isset( $config[ 'readonly' ] ) ? $config[ 'readonly' ] : false;

		if( $disabled ) {

			$class = "$class disabled";
		}

		if( $readonly ) {

			$class = "$class read-only";
		}

		$ratingHtml	= "<div class=\"$class\"><div class=\"wrap-stars\">";

		for( $i = 1; $i <= $stars; $i++ ) {

			if( $selected > 0 && $selected == $i ) {

				$icon = "<span star=\"$i\" class=\"star selected\"></span>";
			}
			else {

				$icon = "<span star=\"$i\" class=\"star\"></span>";
			}

			$ratingHtml .= $icon;
		}

		$ratingHtml	.= "</div></div>";

		return $ratingHtml;
	}
public function getRatingStars( $config = [] ) {

		$class		= isset( $config[ 'class' ] ) && !empty( $config[ 'class' ] ) ? $config[ 'class' ] : 'cmt-rating';
		$stars		= isset( $config[ 'stars' ] ) ? $config[ 'stars' ] : 5;
		$selected	= isset( $config[ 'selected' ] ) ? $config[ 'selected' ] : 0;
		$disabled	= isset( $config[ 'disabled' ] ) ? $config[ 'disabled' ] : false;
		$readonly	= isset( $config[ 'readonly' ] ) ? $config[ 'readonly' ] : false;

		if( $disabled ) {

			$class = "$class disabled";
		}

		if( $readonly ) {

			$class = "$class read-only";
		}

		$ratingHtml	= "<div class=\"$class\"><div class=\"wrap-stars\">";

		for( $i = 1; $i <= $stars; $i++ ) {

			if( $selected > 0 && $selected == $i ) {

				$icon = "<span star=\"$i\" class=\"star selected\"></span>";
			}
			else {

				$icon = "<span star=\"$i\" class=\"star\"></span>";
			}

			$ratingHtml .= $icon;
		}

		$ratingHtml	.= "</div></div>";

		return $ratingHtml;
	}
public function getRatingStars ( $ config = [ ] ) { $ class = isset ( $ config [ 'class' ] ) && ! empty ( $ config [ 'class' ] ) ? $ config [ 'class' ] : 'cmt-rating' ; $ stars = isset ( $ config [ 'stars' ] ) ? $ config [ 'stars' ] : 5 ; $ selected = isset ( $ config [ 'selected' ] ) ? $ config [ 'selected' ] : 0 ; $ disabled = isset ( $ config [ 'disabled' ] ) ? $ config [ 'disabled' ] : false ; $ readonly = isset ( $ config [ 'readonly' ] ) ? $ config [ 'readonly' ] : false ; if ( $ disabled ) { $ class = "$class disabled" ; } if ( $ readonly ) { $ class = "$class read-only" ; } $ ratingHtml = "<div class=\"$class\"><div class=\"wrap-stars\">" ; for ( $ i = 1 ; $ i <= $ stars ; $ i ++ ) { if ( $ selected > 0 && $ selected == $ i ) { $ icon = "<span star=\"$i\" class=\"star selected\"></span>" ; } else { $ icon = "<span star=\"$i\" class=\"star\"></span>" ; } $ ratingHtml .= $ icon ; } $ ratingHtml .= "</div></div>" ; return $ ratingHtml ; }
Generate and return stars html without field. Field must be added within same parent
in case selected value has to be preserved.

@param type $config
@return string
Generate and return stars html without field . Field must be added within same parent in case selected value has to be preserved .