本文整理汇总了PHP中Read::all方法的典型用法代码示例。如果您正苦于以下问题:PHP Read::all方法的具体用法?PHP Read::all怎么用?PHP Read::all使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Read
的用法示例。
在下文中一共展示了Read::all方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: widget
function widget($args, $instance)
{
extract($args);
$title = apply_filters('widget_title', $instance['title']);
$max_columns = $instance['max_columns'];
$sex = $instance['sex'];
$show_sex = isset($instance['show_sex']) ? $instance['show_sex'] : false;
$readings = Read::all(Read::Begun);
if (count($readings) > 0) {
echo $before_widget;
if ($title) {
echo $before_title . $title . $after_title;
}
foreach ($readings as $read) {
echo '<div class="reading">';
if ($read['link'] !== '') {
echo '<a href="' . $read['link'] . '">';
}
if ($read['illustration']) {
echo '<img src="' . $read['illustration'] . '" />';
}
echo '<b>' . $read['title'] . '</b>';
if ($read['link'] !== '') {
echo '</a>';
}
echo '<br />' . $read['author'];
echo '</div>';
}
echo $after_widget;
}
}
示例2:
<hr />
<h3>Current readings</h3>
<?php
$readings = Read::all(Read::Begun);
if (count($readings) > 0) {
include TEMPLATES_DIR . 'read/_readings.php';
} else {
echo '<p>No current readings.</p>';
}
?>
<h3>Finished readings</h3>
<?php
$readings = Read::all(Read::Done);
if (count($readings) > 0) {
include TEMPLATES_DIR . 'read/_readings.php';
} else {
echo '<p>No finished readings.</p>';
}
?>
<hr />
<div class="attribution">
Icons by <a href="http://glyphicons.com">glyphicons.com</a>.
</div>
</div>