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


PHP HTML_QuickForm_group::setValue方法代码示例

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


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

示例1: setValue

 function setValue($value)
 {
     if (empty($value)) {
         $value = array();
     } elseif (is_scalar($value)) {
         if (!is_numeric($value)) {
             $value = strtotime($value);
         }
         // might be a unix epoch, then we fill all possible values
         $arr = explode('-', date('w-d-n-Y-h-H-i-s-a-A', (int) $value));
         $value = array('D' => $arr[0], 'l' => $arr[0], 'd' => $arr[1], 'M' => $arr[2], 'm' => $arr[2], 'F' => $arr[2], 'Y' => $arr[3], 'y' => $arr[3], 'h' => $arr[4], 'H' => $arr[5], 'i' => $arr[6], 's' => $arr[7], 'a' => $arr[8], 'A' => $arr[9]);
     }
     parent::setValue($value);
 }
开发者ID:radicalsuz,项目名称:amp,代码行数:14,代码来源:date.php

示例2: setValue

 function setValue($value)
 {
     if (empty($value)) {
         $value = array();
     } elseif (is_scalar($value)) {
         if (!is_numeric($value)) {
             $value = strtotime($value);
         }
         // might be a unix epoch, then we fill all possible values
         $arr = explode('-', date('w-j-n-Y-g-G-i-s-a-A-W', (int) $value));
         $value = array('D' => $arr[0], 'l' => $arr[0], 'd' => $arr[1], 'M' => $arr[2], 'm' => $arr[2], 'F' => $arr[2], 'Y' => $arr[3], 'y' => $arr[3], 'h' => $arr[4], 'g' => $arr[4], 'H' => $arr[5], 'i' => $this->_trimLeadingZeros($arr[6]), 's' => $this->_trimLeadingZeros($arr[7]), 'a' => $arr[8], 'A' => $arr[9], 'W' => $this->_trimLeadingZeros($arr[10]));
     } else {
         $value = array_map(array($this, '_trimLeadingZeros'), $value);
     }
     parent::setValue($value);
 }
开发者ID:cretzu89,项目名称:EPESI,代码行数:16,代码来源:date.php

示例3: setValue

 /**
  * Sets values for group's elements
  *
  * @param     array     $value    An array of 2 or more values, for the first,
  *                                the second, the third etc. select
  *
  * @access    public
  * @return    void
  */
 function setValue($value)
 {
     // fix for bug #6766. Hope this doesn't break anything more
     // after bug #7961. Forgot that _nbElements was used in
     // _createElements() called in several places...
     $this->_nbElements = max($this->_nbElements, count($value));
     parent::setValue($value);
     $this->_setOptions();
 }
开发者ID:sebastiansanio,项目名称:tallerdeprogramacion2fiuba,代码行数:18,代码来源:hierselect.php

示例4: setValue

 /**
  * Sets values for group's elements
  * 
  * @param     array     $value    An array of 2 or more values, for the first,
  *                                the second, the third etc. select
  *
  * @access    public
  * @return    void
  */
 function setValue($value)
 {
     $this->_nbElements = count($value);
     parent::setValue($value);
     $this->_setOptions();
 }
开发者ID:Esleelkartea,项目名称:kz-adeada-talleres-electricos-,代码行数:15,代码来源:hierselect.php

示例5: setValue

 function setValue($value)
 {
     $trimLeadingZeros = create_function('$a', '$b = ltrim($a, \'0\'); return strlen($b)? $b: \'0\';');
     if (empty($value)) {
         $value = array();
     } elseif (is_scalar($value)) {
         if (!is_numeric($value)) {
             $value = strtotime($value);
         }
         // might be a unix epoch, then we fill all possible values
         $arr = explode('-', date('w-j-n-Y-g-G-i-s-a-A-W', (int) $value));
         $value = array('D' => $arr[0], 'l' => $arr[0], 'd' => $arr[1], 'M' => $arr[2], 'm' => $arr[2], 'F' => $arr[2], 'Y' => $arr[3], 'y' => $arr[3], 'h' => $arr[4], 'g' => $arr[4], 'H' => $arr[5], 'i' => $trimLeadingZeros($arr[6]), 's' => $trimLeadingZeros($arr[7]), 'a' => $arr[8], 'A' => $arr[9], 'W' => $trimLeadingZeros($arr[10]));
     } else {
         $value = array_map($trimLeadingZeros, $value);
     }
     parent::setValue($value);
 }
开发者ID:klando,项目名称:pgpiwik,代码行数:17,代码来源:date.php

示例6: setValue

 function setValue($value)
 {
     if (!is_array($value)) {
         $value = array('firstselect' => '%-');
     } elseif (empty($value['firstselect'])) {
         $value['firstselect'] = '%-';
     } else {
         $value = array('firstselect' => $value['firstselect'], 'firstval' => $value['firstval'], 'secondval' => $value['secondval']);
     }
     switch ($value['firstselect']) {
         case 'betweeninc':
         case 'between':
             $this->_style[0] = $this->_style[2] = $this->_style[1] = $this->_style[3] = array('style' => 'display:inline');
             break;
         default:
             $this->_style[0] = $this->_style[1] = array('style' => 'display:inline');
             $this->_style[2] = $this->_style[3] = array('style' => 'display:none');
             break;
     }
     parent::setValue($value);
 }
开发者ID:demental,项目名称:m,代码行数:21,代码来源:numrange.php

示例7: setValue

 function setValue($value)
 {
     if (empty($value)) {
         $value = array('firstselect' => 'none');
     } elseif (is_array($value) && key_exists('d', $value)) {
         // $value is a date array. Move it to the firstdate array. This needs to get better handled (TODO)
         $value = array('firstselect' => '', 'firstdate' => $value, 'seconddate' => $value);
     }
     switch ($value['firstselect']) {
         case 'is':
         case 'before':
         case 'after':
             $this->_style[0] = $this->_style[1] = array('style' => 'display:inline');
             $this->_style[3] = $this->_style[4] = $this->_style[5] = array('style' => 'display:none');
             $this->_style[2] = 'style="display:none"';
             break;
         case 'between':
             $this->_style[0] = $this->_style[1] = $this->_style[3] = array('style' => 'display:inline');
             $this->_style[2] = 'style="display:inline"';
             $this->_style[4] = $this->_style[5] = array('style' => 'display:none');
             break;
         case 'inthelast':
             $this->_style[0] = $this->_style[4] = $this->_style[5] = array('style' => 'display:inline');
             $this->_style[1] = $this->_style[3] = array('style' => 'display:none');
             $this->_style[2] = 'style="display:none"';
             break;
         default:
             $this->_style[1] = $this->_style[3] = $this->_style[4] = $this->_style[5] = array('style' => 'display:none');
             $this->_style[2] = 'style="display:none"';
             break;
     }
     parent::setValue($value);
 }
开发者ID:demental,项目名称:m,代码行数:33,代码来源:advandate.php


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