本文整理汇总了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;
?>