本文整理汇总了PHP中Time::date方法的典型用法代码示例。如果您正苦于以下问题:PHP Time::date方法的具体用法?PHP Time::date怎么用?PHP Time::date使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Time
的用法示例。
在下文中一共展示了Time::date方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
<?php
use traq\helpers\Atom;
// Entries
$entries = array();
foreach ($tickets as $ticket) {
$entries[] = array('title' => $ticket->summary, 'id' => "tickets:{$ticket->ticket_id}", 'updated' => Time::date("c", $ticket->created_at), 'link' => "http://" . $_SERVER['HTTP_HOST'] . Request::base($ticket->href()), 'author' => array('name' => $ticket->user->name), 'content' => array('type' => "XHTML", 'data' => $ticket->body));
}
// Make feed
$feed = new Atom(array('title' => l('x_ticket_feed', $project->name), 'link' => "http://" . $_SERVER['HTTP_HOST'] . Request::base(), 'feed_link' => "http://" . $_SERVER['HTTP_HOST'] . Request::requestUri(), 'updated' => $entries[0]['updated'], 'entries' => $entries));
// Output feed
header("Content-type: text/plain");
print $feed->build();
示例2:
<div class="right w500">
<?php
echo Message::render();
?>
<h3>Title: <?php
echo $message->title;
?>
</h3>
<p>From: <?php
echo $message->from->username;
?>
</p>
<p>Content: <?php
echo $message->message;
?>
</p>
<p>Date: <?php
echo Time::date($m->created);
?>
</p>
<p><?php
echo html::anchor('message/delete/' . $message->id, 'Delete');
?>
</p>
</div>
示例3: foreach
<p>You do not have a character yet, <?php
echo html::anchor('character', 'create one?');
?>
.</p>
<?php
}
?>
</div>
<div class="right">
<h2>History</h2>
<ul class="no-bullets history">
<?php
foreach ($history as $h) {
?>
<li><span><?php
echo Time::date($h->time, NULL);
?>
:</span> <?php
echo $h->history;
?>
</li>
<?php
}
?>
</ul>
</div>