本文整理汇总了PHP中DateHelper::from_db方法的典型用法代码示例。如果您正苦于以下问题:PHP DateHelper::from_db方法的具体用法?PHP DateHelper::from_db怎么用?PHP DateHelper::from_db使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateHelper
的用法示例。
在下文中一共展示了DateHelper::from_db方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: before_filter
public function before_filter()
{
$this->filter();
$this->layout = false;
$this->current_version = Version::find('first', array('select' => 'versions.*', 'joins' => 'INNER JOIN packages on versions.package_id = packages.id INNER JOIN users ON users.id = packages.user_id', 'order' => 'versions.created_at DESC'));
$date = DateHelper::from_db($this->current_version->created_at);
$date = date(DATE_RFC822, $date);
$this->header("Last-Modified: {$date}");
}
示例2: index
/**
* index
*/
public function index()
{
switch ($this->format) {
case 'xml':
if ($this->user->active == 0) {
exit;
}
$this->layout = false;
$this->render('channel/index.xml');
$this->header('Content-Type: text/xml', 200);
$this->current_version = Version::find('first', array('select' => 'versions.*', 'joins' => 'INNER JOIN packages on versions.package_id = packages.id INNER JOIN users ON users.id = packages.user_id', 'order' => 'versions.version DESC'));
$date = DateHelper::from_db($this->current_version->created_at);
$date = date(DATE_RFC822, $date);
$this->header("Last-Modified: {$date}");
break;
default:
$this->packages = $this->user->packages;
$this->header('Content-Type: text/html', 200);
break;
}
}
示例3: link_to
' alt='avatar'/></td>
<td><?php
echo link_to(h($package->user->username . '/' . $package->name), url_for("PackageController", 'show', $package->user->username, $package->name));
?>
</td>
</tr>
</table>
</td>
<td><span class='small'><?php
echo $version->summary;
?>
</span></td>
<td><?php
echo $version->min_php;
?>
</td>
<td><span class='small'><?php
echo distance_of_time_in_words(DateHelper::from_db($package->updated_at), time(), true);
?>
ago</span></td>
</tr>
<?php
}
?>
</tbody>
</table>
<div id='pagination'>
<?php
echo paginate($packages);
?>
</div>
示例4: load_release
private function load_release()
{
$this->package = Package::find('first', array('conditions' => array('name' => $_GET['name'], 'user_id' => $this->user->id)));
$date = DateHelper::from_db($this->package->updated_at);
$date = date(DATE_RFC822, $date);
$this->header("Last-Modified: {$date}");
$this->version = Version::find('first', array('conditions' => array('version' => $_GET['version'], 'package_id' => $this->package->id)));
$this->data = unserialize($this->version->meta);
}
示例5: foreach
echo $versions->length;
?>
of <?php
echo $total_versions;
?>
</p>
<ul class='versions'>
<?php
foreach ($versions as $_version) {
$url = url_for('VersionController', 'show', $package->user->username, $package->name, $_version->version);
?>
<li><?php
echo link_to($_version->version, $url);
?>
- <?php
echo date("F j, Y", DateHelper::from_db($_version->created_at));
?>
</li>
<?php
}
?>
</ul>
<?php
if ($this->is_logged_in() && $this->user->id == $package->user_id) {
?>
<div>
<div class='right'>
<p><?php
echo delete_link('Delete Package', url_for('PackageController', 'delete', $package->id), true, 'Are you sure? \\n This will delete all versions of this package');
?>
示例6: link_to
?>
</div></td>
<td><?php
echo link_to($version->version, url_for("VersionController", 'show', $package->user->username, $package->name, $version->version));
?>
</td>
<td width='25%'><div class='small summary-right'><?php
echo $version->summary;
?>
</div></td>
<td><?php
echo $version->min_php;
?>
</td>
<td><span class='small'><?php
echo distance_of_time_in_words(DateHelper::from_db($version->created_at), time(), true);
?>
ago</span></td>
<td><?php
echo isset($package->rating) ? PackageRating::convert_to_human($package->rating) : 0;
?>
%</td>
</tr>
<?php
}
?>
</tbody>
</table>
<div id='pagination'>
<?php
echo paginate($packages);