本文整理匯總了PHP中date::user_friendly_date方法的典型用法代碼示例。如果您正苦於以下問題:PHP date::user_friendly_date方法的具體用法?PHP date::user_friendly_date怎麽用?PHP date::user_friendly_date使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類date
的用法示例。
在下文中一共展示了date::user_friendly_date方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: edit
/**
* Make sure that the one to update belongs to the user
* @Developer brandon
* @Date May 19, 2010
*/
public function edit($id = NULL)
{
$journal = ORM::factory('journal', $id);
if ($journal->user->id != user::current()->id) {
url::redirect('');
}
meta::set_title(date::user_friendly_date($journal->created_at) . ' : ' . $journal->title);
parent::edit($id);
}
示例2: send_daily_email
/**
* Send out the daily topic e-mail
* @developer Brandon Hansen
* @date May 25, 2010
*/
public function send_daily_email()
{
if ($topic = ORM::factory('topic')->topic_of_the_day()) {
$users = ORM::factory('user')->users_subscribed_to_topic_of_the_day();
$this->subject = 'Topic of the Day for ' . date::user_friendly_date(date('Y-m-d'));
$this->body = View::factory('emails/daily_topic')->set('topic', $topic)->render();
foreach ($users as $user) {
$this->recipient = $user->email;
$this->send();
}
}
}
示例3: count
<div id="my_account">
<h2>My Account</h2>
<table class="account_layout">
<tr>
<th colspan="2"><?php
echo count($user->journals);
?>
Journal <?php
echo ucwords(inflector::plural('entry', count($user->journals)));
?>
</th>
</tr>
<tr>
<th>Member Since</th>
<td><?php
echo date::user_friendly_date($user->created_at);
?>
</td>
</tr>
<tr>
<th>Username</th>
<td><?php
echo $user->username;
?>
</td>
</tr>
<tr>
<th>Email</th>
<td><?php
echo $user->email;
?>