本文整理匯總了PHP中CakeTime::isToday方法的典型用法代碼示例。如果您正苦於以下問題:PHP CakeTime::isToday方法的具體用法?PHP CakeTime::isToday怎麽用?PHP CakeTime::isToday使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類CakeTime
的用法示例。
在下文中一共展示了CakeTime::isToday方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: follow_expedient
/**
* index method
*
* @return void
*/
public function follow_expedient($idE = null)
{
App::uses('CakeTime', 'Utility');
$confirmas = $this->Confirma->Expediente->find('all', array('conditions' => array('Expediente.user_id' => $idE)));
if (isset($confirmas[0]['Expediente']['previsao_chegada']) && !empty($confirmas[0]['Expediente']['previsao_chegada'])) {
if (CakeTime::isToday($confirmas[0]['Expediente']['previsao_chegada'])) {
/* greet user with a happy birthday message
Enviar um email alertando sobre a data quase vencida.
*/
$vence_hoje = 'Chega Hoje';
if (isset($vence_hoje) && empty($vence_hoje)) {
$vence_hoje = '';
}
$this->set('vence_hoje', $vence_hoje);
}
}
$this->set(compact('confirmas', 'idE'));
}
示例2: days
/**
* Days in theme
* @param int $theme_id
*/
public function days($theme_id = null, $user_id = null)
{
if (!$theme_id) {
return;
}
$options = array('recursive' => -1, 'conditions' => array('Day.theme_id' => $theme_id), 'order' => array('data ASC'));
$rows = $this->Day->find('all', $options);
foreach ($rows as $key => $row) {
$row['Day']['isFuture'] = false;
$row['Day']['isPast'] = false;
$row['Day']['isToday'] = false;
$row['Day']['comments'] = $this->Comment->find('count', array('conditions' => array('Comment.user_id' => !$this->isUser() ? $user_id : $this->getUserId(), 'Comment.day_id' => $row['Day']['id'])));
if (CakeTime::isFuture($row['Day']['data'])) {
$row['Day']['isFuture'] = true;
}
if (CakeTime::isPast($row['Day']['data'])) {
$row['Day']['isPast'] = true;
}
if (CakeTime::isToday($row['Day']['data'])) {
$row['Day']['isToday'] = true;
}
$data[] = $row['Day'];
}
$this->set($data);
$this->set('_serialize', array_keys($data));
}
示例3: isToday
/**
* Returns true if given datetime string is today.
*
* @param int|string|DateTime $dateString UNIX timestamp, strtotime() valid string or DateTime object
* @param string|DateTimeZone $timezone User's timezone string or DateTimeZone object
*
* @return bool True if datetime string is today
* @see CakeTime::isToday()
* @link http://book.cakephp.org/2.0/en/core-libraries/helpers/time.html#testing-time
*/
public function isToday($dateString, $timezone = NULL)
{
return $this->_engine->isToday($dateString, $timezone);
}