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


PHP Zend_Form_Element_Checkbox::setUncheckedValue方法代码示例

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


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

示例1: init

 public function init()
 {
     //user name
     $user_type = new Zend_Form_Element_Text('user_type');
     $user_type->setAttribs(array('id' => 'user_type'));
     $this->addElement($user_type);
     //Main parent of user type
     $db = new Application_Model_DbTable_DbGlobal();
     $rs = $db->getGlobalDb("SELECT ut.user_type_id,ut.user_type FROM rsv_acl_user_type AS ut");
     $options = array();
     foreach ($rs as $read) {
         $options[$read['user_type_id']] = $read['user_type'];
     }
     $user_type_id = new Zend_Form_Element_Select('user_type_id');
     $user_type_id->setMultiOptions($options);
     $this->addElement($user_type_id);
     $rs = $db->getGlobalDb("SELECT acl.acl_id, CONCAT(acl.module,'/', acl.controller,'/', acl.action) AS user_access FROM rsv_acl_acl AS acl");
     $options = array();
     foreach ($rs as $read) {
         $options[$read['acl_id']] = $read['user_access'];
     }
     $user_access_id = new Zend_Form_Element_Select('acl_id');
     $user_access_id->setMultiOptions($options);
     $this->addElement($user_access_id);
     //Project assignment
     //Sophen add here to assign project
     $user_session_id = new Zend_Session_Namespace('auth');
     $id = $user_session_id->user_type_id;
     //echo $user_id;exit;
     $db_user = new Application_Model_DbTable_DbGlobal();
     if ($id == 1) {
         $sql = "select acl.acl_id,CONCAT(acl.module,'/', acl.controller,'/', acl.action) AS user_access from rsv_acl_acl as acl";
     } else {
         $sql = "SELECT acl.acl_id, CONCAT(acl.module,'/', acl.controller,'/', acl.action) AS user_access, acl.status FROM rsv_acl_user_access AS ua \r\n\t\t      INNER JOIN rsv_acl_user_type AS ut ON (ua.user_type_id = ut.parent_id)\r\n\t\t\t  INNER JOIN rsv_acl_acl AS acl ON (acl.acl_id = ua.acl_id) WHERE ut.user_type_id =" . $id;
     }
     //print_r($sql); exit;
     $project = $db_user->getGlobalDb($sql);
     if ($project) {
         $i = 0;
         foreach ($project as $read) {
             //print_r($read);exit;
             $i++;
             $check_fund = new Zend_Form_Element_Checkbox('acl_id_' . $i, array('label' => $read['user_access']));
             $check_fund->setUncheckedValue('')->setCheckedValue($read['acl_id']);
             $this->addElement($check_fund);
         }
         $this->plus = $i;
     }
     //remove decorator
     Application_Model_Decorator::removeAllDecorator($this);
 }
开发者ID:Bornpagna,项目名称:guesehouse,代码行数:51,代码来源:FrmUserAccess.php

示例2: init

 public function init()
 {
     /* Form Elements & Other Definitions Here ... */
     //<input type="text" name="name">
     $product_name = new Zend_Form_Element_Text('name');
     $product_name->setRequired(true);
     $product_name->addFilter(new Zend_Filter_StripTags());
     $product_name->setLabel('Product Name : ');
     //<input type="text" name="price">
     $product_price = new Zend_Form_Element_Text('price');
     $product_price->setRequired();
     $product_price->setLabel('Product Price : ');
     $catName = new Zend_Form_Element_Select('catid');
     $catName->setLabel('Category :');
     //        $user_model = new Application_Model_Category();
     //        $allcats = $user_model->listCategory();
     //
     //
     //        echo' <select id="selectcats" name="cats"> ';
     //
     //        for ($i = 0; $i < count($allcats); $i++) {
     //            $name = $allcats[$i]['name'];
     //            $id = $allcats[$i]['id'];
     //
     //            echo" <option value='<?php echo $id ;
     //<!--////            echo $name;
     ////            echo '</option>';
     ////        }
     ////        echo'  </select>'; -->
     //picture
     $product_picture = new Zend_Form_Element_File('picture');
     $product_picture->setLabel('Image');
     // $product_picture->addValidator('Extension', true, 'jpg,png,gif');
     //$product_picture->
     $product_state = new Zend_Form_Element_Checkbox('state');
     $product_state->setRequired();
     $product_state->setLabel('Product exists');
     $product_state->setCheckedValue(1);
     $product_state->setUncheckedValue(0);
     //$product_state->setChecked(true);
     $submit = new Zend_Form_Element_Submit("Submit");
     $this->setMethod('post');
     $this->setAttrib('enctype', 'multipart/form-data');
     //$this->setAction('');
     $this->addElements(array($product_name, $product_picture, $product_price, $catName, $product_state, $submit));
 }
开发者ID:nguyenkiet,项目名称:cafeteria,代码行数:46,代码来源:Product.php

示例3: init

 public function init()
 {
     $this->setMethod('post');
     $this->setAttrib('id', 'registerInfo');
     $firstName = new Zend_Form_Element_Text('firstName');
     $firstName->setAttrib('autocomplete', 'off');
     $firstName->setAttrib('maxlength', '55');
     $firstName->setLabel('First Name' . '*');
     $firstName->addFilter('StripTags');
     $firstName->addFilter('HtmlEntities');
     $firstName->addFilter('StringTrim');
     $firstName->setRequired(true)->addErrorMessage('Required Field');
     $firstName->addValidator('Regex', true, array('/^[a-zA-Z0-9.-\\s]*$/'))->addErrorMessage('Invalid characters used');
     $firstName->addValidator('StringLength', true, array(1, 95))->addErrorMessage('Invalid Length');
     $lastName = new Zend_Form_Element_Text('lastName');
     $lastName->setAttrib('autocomplete', 'off');
     $lastName->setAttrib('maxlength', '55');
     $lastName->setLabel('Last Name' . '*');
     $lastName->addFilter('StripTags');
     $lastName->addFilter('HtmlEntities');
     $lastName->addFilter('StringTrim');
     $lastName->setRequired(true)->addErrorMessage('Required Field');
     $lastName->addValidator('Regex', true, array('/^[a-zA-Z0-9.,:-\\s]*$/'))->addErrorMessage('Invalid characters used');
     $telephone = new Zend_Form_Element_Text('telephone');
     $telephone->setAttrib('autocomplete', 'off');
     $telephone->setAttrib('maxlength', '15');
     $telephone->setLabel('Telephone' . '*');
     $telephone->addFilter('StripTags');
     $telephone->addFilter('HtmlEntities');
     $telephone->addFilter('StringTrim');
     $telephone->setRequired(true)->addErrorMessage('Required Field');
     $telephone->addValidator('Regex', true, array('/^[0-9.+\\s]*$/'))->addErrorMessage('Invalid characters used');
     $email = new Zend_Form_Element_Text('emailRegister');
     $email->setAttrib('autocomplete', 'off');
     $email->setLabel('Email' . '*');
     $email->addFilter('StripTags');
     $email->addFilter('HtmlEntities');
     $email->addFilter('StringTrim');
     $email->setRequired(true)->addErrorMessage('Required');
     $email->addValidator('EmailAddress')->addErrorMessage('Invalid Email used');
     $email->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $password = new Zend_Form_Element_Password('passwordRegister');
     $password->setAttrib('autocomplete', 'off');
     $password->setLabel('Password*');
     $password->addFilter('StripTags');
     $password->addFilter('HtmlEntities');
     $password->addFilter('StringTrim');
     $password->setRequired(true)->addErrorMessage('Password Required');
     $password->addValidator('StringLength', true, array(0, 255))->addErrorMessage('Required Field');
     $driverCheck = new Zend_Form_Element_Checkbox('driverCheck');
     $driverCheck->setDescription('Driver');
     $driverCheck->setUncheckedValue(0);
     $carModel = new Zend_Form_Element_Text('carModel');
     $carModel->setAttrib('autocomplete', 'off');
     $carModel->setAttrib('maxlength', '55');
     $carModel->setLabel('Car Model' . '*');
     $carModel->addFilter('StripTags');
     $carModel->addFilter('HtmlEntities');
     $carModel->addFilter('StringTrim');
     $carModel->addValidator('Regex', true, array('/^[a-zA-Z0-9.,:-\\s]*$/'))->addErrorMessage('Invalid characters used');
     $carMake = new Zend_Form_Element_Text('carMake');
     $carMake->setAttrib('autocomplete', 'off');
     $carMake->setAttrib('maxlength', '55');
     $carMake->setLabel('Car Make' . '*');
     $carMake->addFilter('StripTags');
     $carMake->addFilter('HtmlEntities');
     $carMake->addFilter('StringTrim');
     $carMake->addValidator('Regex', true, array('/^[a-zA-Z0-9.,:-\\s]*$/'))->addErrorMessage('Invalid characters used');
     $driverLicense = new Zend_Form_Element_Text('driverLicense');
     $driverLicense->setAttrib('autocomplete', 'off');
     $driverLicense->setAttrib('readonly', 'readonly');
     $driverLicense->setAttrib('maxlength', '10');
     $driverLicense->setLabel('Driver License Since' . '*');
     $driverLicense->addFilter('StripTags');
     $driverLicense->addFilter('HtmlEntities');
     $driverLicense->addFilter('StringTrim');
     $driverLicense->addValidator('Regex', true, array('/^[0-9.\\s]*$/'))->addErrorMessage('Invalid characters used');
     $this->addElements(array($firstName, $lastName, $telephone, $email, $password, $driverCheck, $carModel, $carMake, $driverLicense));
     $this->setElementDecorators(array('ViewHelper', 'Label', 'Errors'));
     $this->setDecorators(array('FormElements', 'Form', array('HtmlTag', array('tag' => 'div', 'id' => 'registerFormContainer'))));
     $driverCheck->setDecorators(array('ViewHelper', array('Description', array('placement' => Zend_Form_Decorator_Abstract::APPEND, 'tag' => 'em', 'class' => 'activeCheck')), array('HtmlTag', array('tag' => 'div', 'id' => 'driverCheckBox'))));
     $submit = new Zend_Form_Element_Submit('submit');
     $submit->setLabel('Register');
     $submit->setAttrib('class', 'btn btn-success pull-right');
     $submit->setAttrib('id', 'submitUser');
     $this->addElement($submit);
     $submit->setDecorators(array('ViewHelper'));
 }
开发者ID:bogdanmatra,项目名称:ibm-hackathon,代码行数:88,代码来源:Registration.php

示例4: init


//.........这里部分代码省略.........
     $this->numeroDormitorios->removeDecorator('HtmlTag');
     $this->numeroDormitorios->removeDecorator('Label');
     // Número de baños
     $dbBanyo = new Application_Model_DbTable_TipoBanyo();
     $banyos = $dbBanyo->getBanyosList();
     $this->addElement('select', 'numeroBanyos', array('label' => ' ', 'required' => false, 'filters' => array('stringTrim')));
     /*   foreach($banyos as $key => $value){
             $this->numeroBanyos->addMultiOption($key,$value);
          }*/
     $this->numeroBanyos->addMultiOptions($banyos);
     //$this->numeroBanyos->removeDecorator('Errors');
     $this->numeroBanyos->setAttrib('class', 'form_select_bit');
     $this->numeroBanyos->removeDecorator('HtmlTag');
     $this->numeroBanyos->removeDecorator('Label');
     // Titulo anuncio
     $this->addElement('text', 'titulo', array('label' => 'Titulo (*)', 'required' => true, 'filters' => array('stringTrim')));
     $this->titulo->addValidator('NotEmpty', true, array('messages' => array(Zend_Validate_NotEmpty::IS_EMPTY => 'Ingresar titulo del anuncio.')));
     $this->titulo->setDecorators($this->decoradores);
     $this->titulo->setAttrib('class', 'form_input_contact');
     //$this->titulo->removeDecorator('Errors');
     $this->titulo->removeDecorator('HtmlTag');
     $this->titulo->removeDecorator('Label');
     // Descripcion completa
     $this->addElement('textarea', 'descripcion', array('label' => 'Descripción completa', 'required' => false, 'filters' => array('stringTrim')));
     //$this->descripcion->setDecorators($this->decoradores);
     $this->descripcion->setAttrib('class', 'form_input_contact');
     $this->descripcion->removeDecorator('Errors');
     $this->descripcion->removeDecorator('HtmlTag');
     $this->descripcion->removeDecorator('Label');
     // Alta de suministros
     /* Versión para la web*/
     $altaSuministros = new Zend_Form_Element_Checkbox('altaSuministros');
     $altaSuministros->setLabel('Alta de suministros')->setRequired(FALSE);
     $altaSuministros->setUncheckedValue(0);
     $altaSuministros->setCheckedValue(1);
     $altaSuministros->setAttrib('class', 'form_input_contact_very_small');
     $altaSuministros->removeDecorator('Errors');
     $altaSuministros->removeDecorator('HtmlTag');
     $altaSuministros->removeDecorator('Label');
     $this->addElement($altaSuministros);
     /*
     $this->addElement(
                         'checkBox',
                         'altaSuministros',
                         array   (
                                     'label' => 'Alta de suministros',
                                     'required' => false,
                                     'checkedValue' => '1',
                                     'uncheckedValue'  => '0',
                                 )
                       ); 
     
     $this->altaSuministros->setAttrib('class','form_input_contact_very_small');
     $this->altaSuministros->removeDecorator('Errors');
     $this->altaSuministros->removeDecorator('HtmlTag');
     $this->altaSuministros->removeDecorator('Label');
     */
     // Ascensor
     /*
     $ascensor = new Zend_Form_Element_Checkbox('ascensor');
     $ascensor->setLabel('Ascensor')
              ->setRequired(FALSE);
     
     $ascensor->setUncheckedValue(0);
     $ascensor->setCheckedValue(1);
     $ascensor->setAttrib('class','form_input_contact_very_small');
开发者ID:eulernunez,项目名称:RentAFlat-Zend-1,代码行数:67,代码来源:Anuncio__.php


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