當前位置: 首頁>>代碼示例>>PHP>>正文


PHP Utility::getTimeAgo方法代碼示例

本文整理匯總了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">
開發者ID:JoonasMelin,項目名稱:BotQueue,代碼行數:31,代碼來源:view.php

示例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'));
        ?>
開發者ID:JoonasMelin,項目名稱:BotQueue,代碼行數:31,代碼來源:profile.php

示例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 
}
開發者ID:JoonasMelin,項目名稱:BotQueue,代碼行數:31,代碼來源:draw_activities.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 
}
開發者ID:eric116,項目名稱:BotQueue,代碼行數:31,代碼來源:draw_activities.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 
}
開發者ID:ricberw,項目名稱:BotQueue,代碼行數:31,代碼來源:draw_activities.php


注:本文中的Utility::getTimeAgo方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。