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


PHP Zend_Form_Element::setValue方法代码示例

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


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

示例1: buildForm

 public function buildForm()
 {
     $this->clearElements();
     $hourForm = new Zend_Form_SubForm();
     foreach ($this->data as $record) {
         $elm = new Zend_Form_Element((string) $record['id']);
         $elm->setValue($record);
         $hourForm->addElement($elm);
     }
     $this->addSubForm($hourForm, $this->key_existing);
     // add template element
     $newForm = new Zend_Form_SubForm();
     $elm = new Zend_Form_Element('__unique__');
     $newForm->addElement($elm);
     // add elements based on $_POST, (this is crap but will do for now)
     if (isset($_POST['hour_new'])) {
         foreach ($_POST['hour_new'] as $idx => $values) {
             if ($idx != '__unique__') {
                 $elm = new Zend_Form_Element($idx);
                 $elm->setValue($values);
                 $newForm->addElement($elm);
             }
         }
     }
     $this->addSubForm($newForm, $this->key_new);
 }
开发者ID:TBeijen,项目名称:Zend_Form_Dynamic,代码行数:26,代码来源:My_Form_Hours.php

示例2: setValue

 public function setValue($value)
 {
     $tmp = array();
     if (is_array($value)) {
         foreach ($value as $val) {
             if (empty($val['from']) && empty($val['to'])) {
                 continue;
             } else {
                 if (empty($val['to']) && (!empty($val['from']) && preg_match('/^\\d{4}-\\d{2}-\\d{2}$/', $val['from']))) {
                     $val['to'] = $val['from'];
                 }
             }
             array_push($tmp, $val);
         }
     }
     return parent::setValue($tmp);
 }
开发者ID:anunay,项目名称:stentors,代码行数:17,代码来源:DateRangePicker.php

示例3: frmSearch

 public function frmSearch($data = null)
 {
     $request = Zend_Controller_Front::getInstance()->getRequest();
     $db = new Application_Model_DbTable_DbGlobal();
     $search_text = new Zend_Form_Element("txt_search");
     $search_text->setValue($request->getParam("txt_search"));
     $cat_id = new Zend_Form_Element_Select("cat_id");
     $cat_id->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
     $category = $db->getAllProCategories();
     $option_category = array(0 => $this->tr->translate("CHOOSE_CATEGORY"));
     foreach ($category as $row_cat) {
         $option_category[$row_cat["cat_id"]] = $row_cat["cat_name_km"] . " - " . $row_cat["cat_name_en"];
     }
     $cat_id->setMultiOptions($option_category);
     $cat_id->setValue($request->getParam("cat_id"));
     $brand = new Zend_Form_Element_Select("brand");
     $brand->setAttribs(array('class' => 'select', 'style' => 'width:100%'));
     $row_brand = $db->getAllBrand();
     $option_brand = array(0 => $this->tr->translate("CHOOSE_BRAND"));
     foreach ($row_brand as $rs) {
         $option_brand[$rs["brand_id"]] = $rs["name_kh"] . " - " . $rs["name_en"];
     }
     $brand->setMultiOptions($option_brand);
     $brand->setValue($request->getParam("brand"));
     if ($data != null) {
     }
     return $this->addElements(array($search_text, $cat_id, $brand));
 }
开发者ID:sarankh80,项目名称:opsstock,代码行数:28,代码来源:Frmproduct.php

示例4: setModelosImpressao

 /**
  * Carrega os modelos de impressao no elemento
  *
  * @param Zend_Form_Element $oElemento
  * @param string            $sValor
  * @return $this
  */
 public function setModelosImpressao(Zend_Form_Element $oElemento, $sValor = '')
 {
     $aValores = array('1' => 'Modelo 1', '2' => 'Modelo 2', '3' => 'Modelo 3', '4' => 'Modelo 4');
     $oElemento->addMultiOptions($aValores);
     $oElemento->setValue($sValor);
     return $this;
 }
开发者ID:arendasistemasintegrados,项目名称:mateusleme,代码行数:14,代码来源:ParametroPrefeituraNfse.php


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