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