本文整理匯總了PHP中XenForo_Locale::getRtlDateTimeMarker方法的典型用法代碼示例。如果您正苦於以下問題:PHP XenForo_Locale::getRtlDateTimeMarker方法的具體用法?PHP XenForo_Locale::getRtlDateTimeMarker怎麽用?PHP XenForo_Locale::getRtlDateTimeMarker使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類XenForo_Locale
的用法示例。
在下文中一共展示了XenForo_Locale::getRtlDateTimeMarker方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: helperDateTimeHtml
/**
* Returns an <abbr> tag with a date suitable for Javascript refreshing
*
* @param integer $timestamp
* @param array $attributes
*
* @return string <abbr class="DateTime" data-unixtime="$timestamp"...
*/
public static function helperDateTimeHtml($timestamp, $attributes = array())
{
$class = empty($attributes['class']) ? '' : ' ' . htmlspecialchars($attributes['class']);
unset($attributes['time'], $attributes['class']);
$attribs = self::getAttributes($attributes);
$time = XenForo_Locale::dateTime($timestamp, 'separate', self::$_language);
if ($time['relative']) {
$tag = 'abbr';
$data = ' data-time="' . $timestamp . '" data-diff="' . (XenForo_Application::$time - $timestamp) . '" data-datestring="' . $time['date'] . '" data-timestring="' . $time['time'] . '"';
$value = $time['string'];
} else {
$tag = 'span';
if (!isset($attributes['title'])) {
$data = ' title="' . $time['string'] . '"';
// empty this to remove tooltip from non-relative dates
} else {
$data = '';
}
$value = $time['date'];
}
$rtlPrefix = XenForo_Locale::getRtlDateTimeMarker(self::$_language);
return "<{$tag} class=\"DateTime{$class}\"{$attribs}{$data}>{$rtlPrefix}{$value}</{$tag}>";
}