当前位置: 首页>>代码示例>>PHP>>正文


PHP Date::formatToJs方法代码示例

本文整理汇总了PHP中Contao\Date::formatToJs方法的典型用法代码示例。如果您正苦于以下问题:PHP Date::formatToJs方法的具体用法?PHP Date::formatToJs怎么用?PHP Date::formatToJs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Contao\Date的用法示例。


在下文中一共展示了Date::formatToJs方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: row


//.........这里部分代码省略.........
            if (in_array($this->strInputName, $paletteFields) || \Input::get('act') == 'overrideAll') {
                $objWidget->validate();
                if ($objWidget->hasErrors()) {
                    // Skip mandatory fields on auto-submit (see #4077)
                    if (\Input::post('SUBMIT_TYPE') != 'auto' || !$objWidget->mandatory || $objWidget->value != '') {
                        $this->noReload = true;
                    }
                } elseif ($objWidget->submitInput()) {
                    $varValue = $objWidget->value;
                    // Sort array by key (fix for JavaScript wizards)
                    if (is_array($varValue)) {
                        ksort($varValue);
                        $varValue = serialize($varValue);
                    }
                    // Convert file paths in src attributes (see #5965)
                    if ($varValue && isset($arrData['eval']['rte']) && strncmp($arrData['eval']['rte'], 'tiny', 4) === 0) {
                        $varValue = \StringUtil::srcToInsertTag($varValue);
                    }
                    // Save the current value
                    try {
                        $this->save($varValue);
                    } catch (\Exception $e) {
                        $this->noReload = true;
                        $objWidget->addError($e->getMessage());
                    }
                }
            }
        }
        $wizard = '';
        $strHelpClass = '';
        // Date picker
        if ($arrData['eval']['datepicker']) {
            $rgxp = $arrData['eval']['rgxp'];
            $format = \Date::formatToJs(\Config::get($rgxp . 'Format'));
            switch ($rgxp) {
                case 'datim':
                    $time = ",\n      timePicker:true";
                    break;
                case 'time':
                    $time = ",\n      pickOnly:\"time\"";
                    break;
                default:
                    $time = '';
                    break;
            }
            $wizard .= ' ' . \Image::getHtml('assets/datepicker/images/icon.svg', '', 'title="' . \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['datepicker']) . '" id="toggle_' . $objWidget->id . '" style="cursor:pointer"') . '
  <script>
    window.addEvent("domready", function() {
      new Picker.Date($("ctrl_' . $objWidget->id . '"), {
        draggable: false,
        toggle: $("toggle_' . $objWidget->id . '"),
        format: "' . $format . '",
        positionOffset: {x:-211,y:-209}' . $time . ',
        pickerClass: "datepicker_bootstrap",
        useFadeInOut: !Browser.ie,
        startDay: ' . $GLOBALS['TL_LANG']['MSC']['weekOffset'] . ',
        titleFormat: "' . $GLOBALS['TL_LANG']['MSC']['titleFormat'] . '"
      });
    });
  </script>';
        }
        // Color picker
        if ($arrData['eval']['colorpicker']) {
            // Support single fields as well (see #5240)
            $strKey = $arrData['eval']['multiple'] ? $this->strField . '_0' : $this->strField;
            $wizard .= ' ' . \Image::getHtml('pickcolor.svg', $GLOBALS['TL_LANG']['MSC']['colorpicker'], 'title="' . \StringUtil::specialchars($GLOBALS['TL_LANG']['MSC']['colorpicker']) . '" id="moo_' . $this->strField . '"') . '
开发者ID:qzminski,项目名称:contao-core-bundle,代码行数:67,代码来源:DataContainer.php


注:本文中的Contao\Date::formatToJs方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。