本文整理汇总了PHP中Album::top方法的典型用法代码示例。如果您正苦于以下问题:PHP Album::top方法的具体用法?PHP Album::top怎么用?PHP Album::top使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Album
的用法示例。
在下文中一共展示了Album::top方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: count
<?php
$top_album = Album::top();
$top_album = count($top_album) != 0 ? $top_album[0] : null;
?>
<div class="nephritis">
<div>
<?php
if (is_null($top_album)) {
?>
<p class="padded">
<span class="glyphicon glyphicon-music"></span> No Top Album Available
</p>
<?php
} else {
?>
<p class="padded">
<span class="glyphicon glyphicon-headphones"></span> Top album
<span class="pull-right text-right">
<?php
print (double) $top_album->getAverage();
?>
/ 10<br>
<small><?php
print (int) $top_album->countRaters();
?>
rater<?php
if ((int) $top_album->countRaters() > 1) {
print 's';
}
示例2:
<?php
require_once "config/config.inc";
$top_songs = Song::top(100);
$top_albums = Album::top(100);
$top_artists = Artist::top(100);
?>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>
<?php
print TITLE;
?>
</title>
<?php
require_once "sections/links.php";
?>
</head>
<body>
<?php
require_once "sections/menu.php";
?>
<section class="container">
<div class="row">
<div class="col-md-4">
<div class="belize-hole">
<p class="padded">
<h3 class="padded text-center"><span class="glyphicon glyphicon-music"></span> Top Songs</h3>