本文整理汇总了PHP中DateTimeObj::getSetting方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeObj::getSetting方法的具体用法?PHP DateTimeObj::getSetting怎么用?PHP DateTimeObj::getSetting使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeObj
的用法示例。
在下文中一共展示了DateTimeObj::getSetting方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: lastUpdateFilterList
public static function lastUpdateFilterList()
{
if (!file_exists(WORKSPACE . self::$file)) {
return false;
}
return DateTimeObj::get(DateTimeObj::getSetting('datetime_format'), filemtime(WORKSPACE . self::$file));
}
示例2: prepareTableValue
public function prepareTableValue($data, XMLElement $link = NULL, $entry_id = null)
{
$value = null;
if (isset($data['value'])) {
$value = DateTimeObj::format($data['value'], DateTimeObj::getSetting('datetime_format'), true);
}
return parent::prepareTableValue(array('value' => $value), $link, $entry_id = null);
}
示例3: formatDate
/**
* Format the $data parameter according to this field's settings.
*
* @since Symphony 2.6.0
* @param array $date
* The date to format
* @return string
*/
public function formatDate($date)
{
// Get format
$format = 'date_format';
if ($this->get('time') === 'yes') {
$format = 'datetime_format';
}
return DateTimeObj::format($date, DateTimeObj::getSetting($format));
}
示例4: prepareTextValue
public function prepareTextValue($data, $entry_id = null)
{
$value = '';
if (isset($data['value'])) {
$value = DateTimeObj::format($data['value'], DateTimeObj::getSetting('datetime_format'), true);
}
return $value;
}
示例5: Calendar
/**
* Generates a XMLElement representation of a Symphony calendar.
*
* @since Symphony 2.6
* @param boolean $time
* Wheather or not to display the time, defaults to true
* @return XMLElement
*/
public static function Calendar($time = true)
{
$calendar = new XMLElement('div');
$calendar->setAttribute('class', 'calendar');
$date = DateTimeObj::convertDateToMoment(DateTimeObj::getSetting('date_format'));
if ($date) {
if ($time === true) {
$separator = DateTimeObj::getSetting('datetime_separator');
$time = DateTimeObj::convertTimeToMoment(DateTimeObj::getSetting('time_format'));
$calendar->setAttribute('data-calendar', 'datetime');
$calendar->setAttribute('data-format', $date . $separator . $time);
} else {
$calendar->setAttribute('data-calendar', 'date');
$calendar->setAttribute('data-format', $date);
}
}
return $calendar;
}