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


PHP Zend_Form_Element_Xhtml::setValue方法代码示例

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


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

示例1: setValue

 public function setValue($value)
 {
     if (is_array($value)) {
         if (isset($value['value'])) {
             parent::setValue($value['value']);
         }
         if (isset($value['overwrite'])) {
             if ($value['overwrite'] == '1' || $value['overwrite'] === true) {
                 $this->overwrite = true;
             } else {
                 $this->overwrite = false;
             }
         }
     } else {
         parent::setValue($value);
     }
 }
开发者ID:hausdesign,项目名称:zf-library,代码行数:17,代码来源:TextareaOverwrite.php

示例2: setValue

 /**
  * Set value
  *
  * If value matches checked value, sets to that value, and sets the checked
  * flag to true.
  *
  * Any other value causes the unchecked value to be set as the current
  * value, and the checked flag to be set as false.
  *
  *
  * @param  mixed $value
  * @return Zend_Form_Element_Checkbox
  */
 public function setValue($value)
 {
     if ($value == $this->getCheckedValue()) {
         parent::setValue($value);
         $this->checked = true;
     } else {
         parent::setValue($this->getUncheckedValue());
         $this->checked = false;
     }
     return $this;
 }
开发者ID:SandeepUmredkar,项目名称:PortalSMIP,代码行数:24,代码来源:Checkbox.php

示例3: setValue

 public function setValue($value)
 {
     if (is_array($value)) {
         $value = $value['year'] . '-' . $value['month'] . '-' . $value['day'];
         if ($value == "0-0-0") {
             return parent::setValue(NULL);
         }
     }
     return parent::setValue($value);
 }
开发者ID:febryantosulistyo,项目名称:ClassicSocial,代码行数:10,代码来源:Date.php

示例4: setValue

 public function setValue($value)
 {
     if (is_array($value)) {
         // Process date
         $year = null;
         $month = null;
         $day = null;
         if (isset($value['date']) && preg_match('/^(\\d+)\\/(\\d+)\\/(\\d+)$/', $value['date'], $m)) {
             array_shift($m);
             $year = $m[stripos($this->dateFormat, 'y')];
             $month = $m[stripos($this->dateFormat, 'm')];
             $day = $m[stripos($this->dateFormat, 'd')];
         } else {
             if (isset($value['year']) && is_numeric($value['year'])) {
                 $year = $value['year'];
             }
             if (isset($value['month']) && is_numeric($value['month'])) {
                 $month = $value['month'];
             }
             if (isset($value['day']) && is_numeric($value['day'])) {
                 $day = $value['day'];
             }
         }
         // Process time
         $hour = null;
         $minute = null;
         $second = null;
         if (isset($value['hour']) && is_numeric($value['hour']) && in_array($value['hour'], $this->getHourOptions())) {
             $hour = $value['hour'];
         }
         if (isset($value['minute']) && is_numeric($value['minute']) && in_array($value['minute'], $this->getMinuteOptions())) {
             $minute = $value['minute'];
         }
         if (isset($value['second']) && is_numeric($value['second'])) {
             $second = $value['second'];
         }
         if (isset($value['ampm']) && in_array($value['ampm'], $this->getAMPMOptions())) {
             if ($value['ampm'] == 'PM' && $hour < 12 && null !== $hour) {
                 $hour += 12;
             } else {
                 if ($value['ampm'] == 'AM' && $hour == 12) {
                     $hour = 0;
                 }
             }
         }
         // Get values
         $formatString = '%1$04d-%2$02d-%3$02d';
         if (null !== $hour && null !== $minute) {
             $formatString .= ' %4$02d:%5$02d:%6$02d';
         }
         $valueString = sprintf($formatString, $year, $month, $day, $hour, $minute, $second);
         $value = $valueString;
     }
     return parent::setValue($value);
 }
开发者ID:robeendey,项目名称:ce,代码行数:55,代码来源:CalendarDateTime.php

示例5: setValue

 /**
  * Set value
  *
  * If non-null, sets checked flag to true
  * 
  * @param mixed $value 
  * @return void
  */
 public function setValue($value)
 {
     $value = ($value === null) ? 0 : 1;
     $this->checked = ($value === 0) ? false : true;
     return parent::setValue($value);
 }
开发者ID:jorgenils,项目名称:zend-framework,代码行数:14,代码来源:Checkbox.php

示例6: setValue

 /**
  * Set element value
  *
  * @param  mixed $value
  * @return \MUtil_Form_Element_Table (continuation pattern)
  */
 public function setValue($value)
 {
     // $this->setElementsBelongTo($this->getName());
     if ($this->_subForm && $value) {
         $this->_subForm->setElementsBelongTo($this->getName());
         foreach ($value as $id => $row) {
             if (isset($this->_subForms[$id])) {
                 $this->_subForms[$id]->populate($row);
             } else {
                 $subForm = clone $this->_subForm;
                 $name = $this->getName() . '[' . $id . ']';
                 $subForm->setElementsBelongTo($name);
                 $subForm->setName($name);
                 $subForm->populate($row);
                 $this->_subForms[$id] = $subForm;
             }
         }
     }
     return parent::setValue($value);
 }
开发者ID:GemsTracker,项目名称:MUtil,代码行数:26,代码来源:Table.php

示例7: setValue

 public function setValue($value)
 {
     if (is_array($value)) {
         // Process date
         $year = null;
         $month = null;
         $day = null;
         $localeObject = Zend_Registry::get('Locale');
         $dateLocaleString = $localeObject->getTranslation('long', 'Date', $localeObject);
         // overwrite date format
         if (isset($value['date']) && preg_match('/^(\\d+)-(\\d+)-(\\d+)$/', $value['date'], $m)) {
             array_shift($m);
             $year = $m[stripos($this->dateFormat, 'y')];
             $month = $m[stripos($this->dateFormat, 'm')];
             $day = $m[stripos($this->dateFormat, 'd')];
         } else {
             if (isset($value['year']) && is_numeric($value['year'])) {
                 $year = $value['year'];
             }
             if (isset($value['month']) && is_numeric($value['month'])) {
                 $month = $value['month'];
             }
             if (isset($value['day']) && is_numeric($value['day'])) {
                 $day = $value['day'];
             }
         }
         // Get values
         $formatString = '%1$04d-%2$02d-%3$02d';
         $valueString = sprintf($formatString, $year, $month, $day);
         $value = $valueString;
     }
     return parent::setValue($value);
 }
开发者ID:hoalangoc,项目名称:ftf,代码行数:33,代码来源:YnCalendarSimple.php

示例8: setValue

 public function setValue($value)
 {
     parent::setValue($value);
 }
开发者ID:noureddineexcen,项目名称:excen.orders.new,代码行数:4,代码来源:Ckeditor.php


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