本文整理汇总了PHP中Utility::getTimeAgo方法的典型用法代码示例。如果您正苦于以下问题:PHP Utility::getTimeAgo方法的具体用法?PHP Utility::getTimeAgo怎么用?PHP Utility::getTimeAgo使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Utility
的用法示例。
在下文中一共展示了Utility::getTimeAgo方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
if ($bot->get('status') == 'error') {
?>
<?php
echo Controller::byName('htmltemplate')->renderView('errorbar', array('message' => "This bot is offline with the following error: " . $bot->get('error_text')));
?>
<?php
}
?>
<div class="row">
<div class="span6">
<?php
if ($webcam->isHydrated()) {
?>
<h3>Latest Image - <span class="muted"><?php
echo Utility::getTimeAgo($webcam->get('add_date'));
?>
</span></h3>
<img src="<?php
echo $webcam->getDownloadURL();
?>
">
<?php
} else {
?>
<img src="/img/colorbars.gif">
<?php
}
?>
</div>
<div class="span6">
示例2:
<th>Last active</th>
<td><?php
echo Utility::getTimeAgo($user->get('last_active'));
?>
(<?php
echo Utility::formatDate($user->get('last_active'));
?>
)</td>
</tr>
<?php
}
?>
<tr>
<th>I joined</th>
<td><?php
echo Utility::getTimeAgo($user->get('registered_on'));
?>
(<?php
echo Utility::formatDate($user->get('registered_on'));
?>
)</td>
</tr>
</tbody>
</table>
<?php
if ($user->get('bio')) {
?>
<p>
<?php
echo Utility::convertToHTML($user->get('bio'));
?>
示例3: foreach
<?php
foreach ($activities as $row) {
?>
<?php
$datetime = $row['DateTime'];
?>
<tr>
<td><?php
echo $row['user_link'];
?>
</td>
<td><?php
echo $row['activity'];
?>
</td>
<td><span class="muted"><?php
echo Utility::getTimeAgo($datetime->format("Y-m-d H:i:s"));
?>
</span></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} else {
?>
<b>No activity found.</b>
<?php
}
示例4:
<?php
$activity = $row['Activity'];
?>
<?php
$datetime = $activity->get('action_date');
?>
<tr>
<td><?php
echo $user->getLink();
?>
</td>
<td><?php
echo $activity->get('activity');
?>
</td>
<td><span class="muted"><?php
echo Utility::getTimeAgo($datetime);
?>
</span></td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} else {
?>
<b>No activity found.</b>
<?php
}
示例5:
<?php
$user = $row['User'];
?>
<?php
$activity = $row['Activity'];
?>
<tr>
<td><?php
echo $user->getLink();
?>
</td>
<td><?php
echo $activity->get('activity');
?>
</td>
<td><?php
echo Utility::getTimeAgo($activity->get('action_date'));
?>
</td>
</tr>
<?php
}
?>
</tbody>
</table>
<?php
} else {
?>
<b>No activity found.</b>
<?php
}