本文整理汇总了PHP中Carbon::diffInDays方法的典型用法代码示例。如果您正苦于以下问题:PHP Carbon::diffInDays方法的具体用法?PHP Carbon::diffInDays怎么用?PHP Carbon::diffInDays使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Carbon
的用法示例。
在下文中一共展示了Carbon::diffInDays方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Carbon
<?
/**
* TITLE: Главная страница
* AVAILABLE_ONLY_IN_ADVANCED_MODE
*/
?>
<?php
$created = new Carbon(Config::get('site.date_over_action'));
$now = Carbon::now();
$difference = $created->diff($now)->days < 1 ? 'Сегодня заканчивается регистрация в конкурсе.' : 'До окончания регистрации в конкурсе осталось ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '.';
$created = new Carbon(Config::get('site.date_final_action'));
$now = Carbon::now();
$difference_final = $created->diff($now)->days < 1 ? 'Сегодня шоу-финал.' : 'До шоу-финала остается ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '. Зарегистрируйся на сайте и покажи свой талант всем!';
$map = array();
if (isset($page->blocks['map']['meta']['content']) && !empty($page->blocks['map']['meta']['content'])) {
$map = json_decode($page->blocks['map']['meta']['content'], TRUE);
}
$participants = Accounts::where('group_id', 4)->where('in_main_page', 1)->with('ulogin', 'likes')->take(15)->get();
foreach ($participants as $index => $participant) {
$participants[$index]['like_disabled'] = FALSE;
}
if (isset($_COOKIE['votes_list'])) {
$users_ids = json_decode($_COOKIE['votes_list']);
foreach ($participants as $index => $participant) {
if (in_array($participant->id, $users_ids)) {
$participants[$index]['like_disabled'] = TRUE;
}
}
}
?>
@extends(Helper::layout())
示例2: Carbon
<?
/**
* TITLE: О проекте
* AVAILABLE_ONLY_IN_ADVANCED_MODE
*/
?>
<?php
$created = new Carbon(Config::get('site.date_over_action'));
$now = Carbon::now();
$difference = $created->diff($now)->days < 1 ? 'Сегодня заканчивается регистраця в конкурсе.' : 'До окончания регистрации в конкурсе осталось ' . $created->diffInDays($now) . ' ' . Lang::choice('день|дня|дней', $created->diffInDays($now)) . '.';
$steps = array();
if (isset($page['blocks']['etap_1'])) {
if (isset($page['blocks']['etap_1']['meta']['content']) && !empty($page['blocks']['etap_1']['meta']['content'])) {
$steps['etap_1'] = json_decode($page['blocks']['etap_1']['meta']['content'], TRUE);
}
}
if (isset($page['blocks']['etap_2'])) {
if (isset($page['blocks']['etap_2']['meta']['content']) && !empty($page['blocks']['etap_2']['meta']['content'])) {
$steps['etap_2'] = json_decode($page['blocks']['etap_2']['meta']['content'], TRUE);
}
}
if (isset($page['blocks']['etap_3'])) {
if (isset($page['blocks']['etap_3']['meta']['content']) && !empty($page['blocks']['etap_3']['meta']['content'])) {
$steps['etap_3'] = json_decode($page['blocks']['etap_3']['meta']['content'], TRUE);
}
}
$nominations = array();
if (isset($page['blocks']['nom_1'])) {
if (isset($page['blocks']['nom_1']['meta']['content']) && !empty($page['blocks']['nom_1']['meta']['content'])) {
$nominations['nom_1'] = json_decode($page['blocks']['nom_1']['meta']['content'], TRUE);
}