yiiapi/framework/web/widgets/CStarRating.php
(开头部分) 6KB这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。
<?php
/**
* CStarRating class file.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @link http://www.yiiframework.com/
* @copyright 2008-2013 Yii Software LLC
* @license http://www.yiiframework.com/license/
*/
/**
* CStarRating displays a star rating control that can collect user rating input.
*
* CStarRating is based on {@link http://www.fyneworks.com/jquery/star-rating/ jQuery Star Rating Plugin}.
* It displays a list of stars indicating the rating values. Users can toggle these stars
* to indicate their rating input. On the server side, when the rating input is submitted,
* the value can be retrieved in the same way as working with a normal HTML input.
* For example, using
* <pre>
* $this->widget('CStarRating',array('name'=>'rating'));
* </pre>
* we can retrieve the rating value via <code>$_POST['rating']</code>.
*
* CStarRating allows customization of its appearance. It also supports empty rating as well as read-only rating.
*
* @author Qiang Xue <qiang.xue@gmail.com>
* @package system.web.widgets
* @since 1.0
*/
class CStarRating extends CInputWidget
{
/**
* @var integer the number of stars. Defaults to 5.
*/
public $starCount=5;
/**
* @var mixed the minimum rating allowed. This can be either an integer or a float value. Defaults to 1.
*/
public $minRating=1;
/**
* @var mixed the maximum rating allowed. This can be either an integer or a float value. Defaults to 10.
*/
public $maxRating=10;
/**
* @var mixed the step size of rating. This is the minimum difference between two rating values. Defaults to 1.
*/
public $ratingStepSize=1;
/**
* @var mixed the CSS file used for the widget. Defaults to null, meaning
* using the default CSS file included together with the widget.
* If false, no CSS file will be used. Otherwise, the specified CSS file
* will be included when using this widget.
*/
public $cssFile;
/**
* @var array the titles associated with the rating options. The keys are ratings and the values are the corresponding titles.
* Defaults to null, meaning using the rating value as the title.
*/
public $titles;
/**
后面还有 145 行代码,购买后查看完整代码
24 小时内免费解锁 3 个项目,之后 1 积分/个。 规则说明
AI 解读
登录后可用,每次 10 积分,解读结果公开显示在下面。
还没有人解读过这个文件。
