本文整理汇总了PHP中Results::getRankings方法的典型用法代码示例。如果您正苦于以下问题:PHP Results::getRankings方法的具体用法?PHP Results::getRankings怎么用?PHP Results::getRankings使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Results
的用法示例。
在下文中一共展示了Results::getRankings方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: actionRankings
public function actionRankings()
{
$region = $this->sGet('region', 'China');
$type = $this->sGet('type', 'single');
$event = $this->sGet('event', '333');
$gender = $this->sGet('gender', 'all');
$page = $this->iGet('page', 1);
if (!in_array($type, Results::getRankingTypes())) {
$type = 'single';
}
if (!array_key_exists($gender, Persons::getGenders())) {
$gender = 'all';
}
if (!array_key_exists($event, Events::getNormalEvents())) {
$event = '333';
}
if (!Region::isValidRegion($region)) {
$region = 'China';
}
if ($page < 1) {
$page = 1;
}
$rankings = Results::getRankings($region, $type, $event, $gender, $page);
if ($page > ceil($rankings['count'] / 100)) {
$page = ceil($rankings['count'] / 100);
}
$this->title = 'Personal Rankings';
$this->pageTitle = array('Personal Rankings', Yii::t('Region', $region), Yii::t('event', Events::getFullEventName($event)), ucfirst($gender), ucfirst($type));
$this->description = Yii::t('statistics', 'Global personal rankings in each official event are listed, based on the the official WCA rankings.');
$this->setWeiboShareDefaultText('各国魔方选手在各官方项目的个人成绩排名展示');
$this->render('rankings', array('rankings' => $rankings, 'region' => $region, 'type' => $type, 'event' => $event, 'gender' => $gender, 'page' => $page));
}