本文整理汇总了PHP中XoopsLocale::getFormatShortDate方法的典型用法代码示例。如果您正苦于以下问题:PHP XoopsLocale::getFormatShortDate方法的具体用法?PHP XoopsLocale::getFormatShortDate怎么用?PHP XoopsLocale::getFormatShortDate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类XoopsLocale
的用法示例。
在下文中一共展示了XoopsLocale::getFormatShortDate方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: render
/**
* render
*
* @return string rendered form element
*/
public function render()
{
static $included = false;
$xoops = \Xoops::getInstance();
$ele_value = (string) $this->getValue(false);
$display_value = $ele_value;
if (0 < (int) $ele_value) {
$display_value = date(\XoopsLocale::getFormatShortDate(), $ele_value);
}
if ($this->getSize() > $this->getMaxcols()) {
$maxcols = $this->getMaxcols();
} else {
$maxcols = $this->getSize();
}
$this->addAttribute('class', 'span' . $maxcols);
$dlist = $this->isDatalist();
if (!empty($dlist)) {
$this->addAttribute('list', 'list_' . $this->getName());
}
$attributes = $this->renderAttributeString();
$xoops->theme()->addBaseStylesheetAssets('@jqueryuicss');
$xoops->theme()->addBaseScriptAssets('@jqueryui');
// TODO - select and apply script by locale, example:
// $i18nScript = 'media/jquery/ui/i18n/datepicker-es.js';
// $xoops->theme()->addBaseScriptAssets($i18nScript);
$xoops->theme()->addScript('', '', ' $(function() { $( "#' . $this->getAttribute('id') . '" ).datepicker({' . 'showOn: "button", buttonImageOnly: false, ' . 'buttonImage: "' . $xoops->url('media/xoops/images/icons/calendar.png') . '", ' . 'buttonImageOnly: false, buttonText: "' . \XoopsLocale::A_SELECT . '" }); }); ');
return '<input ' . $attributes . 'value="' . $display_value . '" ' . $this->getExtra() . ' >';
}
示例2: init
/**
* init - called by parent::_construct
*
* @return void
*/
protected function init()
{
$this->setTemplate('module:xmf/xmf_feed.tpl');
//$this->disableLogger();
global $xoopsConfig;
$this->_title = $xoopsConfig['sitename'];
$this->_url = \XoopsBaseConfig::get('url');
$this->_description = $xoopsConfig['slogan'];
$this->_language = \XoopsLocale::getLangCode();
$this->_charset = \XoopsLocale::getCharset();
$this->_pubdate = date(\XoopsLocale::getFormatShortDate(), time());
$this->_lastbuild = \XoopsLocale::formatTimestamp(time(), 'D, d M Y H:i:s');
$this->_webmaster = $xoopsConfig['adminmail'];
$this->_editor = $xoopsConfig['adminmail'];
$this->_generator = \Xoops::VERSION;
$this->_copyright = 'Copyright ' . \XoopsLocale::formatTimestamp(time(), 'Y') . ' ' . $xoopsConfig['sitename'];
$this->_image_title = $this->_title;
$this->_image_url = \XoopsBaseConfig::get('url') . '/images/logo.gif';
$this->_image_link = $this->_url;
}