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


PHP FieldGroup::setID方法代码示例

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


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

示例1: Field

 public function Field()
 {
     $field = new FieldGroup($this->name);
     $field->setID("{$this->name}_Holder");
     list($countryCode, $areaCode, $phoneNumber, $extension) = $this->parseValue();
     $hasTitle = false;
     if ($this->value == "") {
         $countryCode = $this->countryCode;
         $areaCode = $this->areaCode;
         $extension = $this->ext;
     }
     if ($this->countryCode !== null) {
         $field->push(new NumericField($this->name . '[Country]', '+', $countryCode, 4));
     }
     if ($this->areaCode !== null) {
         $field->push(new NumericField($this->name . '[Area]', '(', $areaCode, 4));
         $field->push(new NumericField($this->name . '[Number]', ')', $phoneNumber, 10));
     } else {
         $field->push(new NumericField($this->name . '[Number]', '', $phoneNumber, 10));
     }
     if ($this->ext !== null) {
         $field->push(new NumericField($this->name . '[Extension]', 'ext', $extension, 6));
     }
     return $field;
 }
开发者ID:SustainableCoastlines,项目名称:loveyourwater,代码行数:25,代码来源:PhoneNumberField.php

示例2: Field

 public function Field($properties = array())
 {
     $fields = new FieldGroup($this->name);
     $fields->setID("{$this->name}_Holder");
     list($countryCode, $areaCode, $phoneNumber, $extension) = $this->parseValue();
     if ($this->value == "") {
         $countryCode = $this->countryCode;
         $areaCode = $this->areaCode;
         $extension = $this->ext;
     }
     if ($this->countryCode !== null) {
         $fields->push(new NumericField($this->name . '[Country]', '+', $countryCode, 4));
     }
     if ($this->areaCode !== null) {
         $fields->push(new NumericField($this->name . '[Area]', '(', $areaCode, 4));
         $fields->push(new NumericField($this->name . '[Number]', ')', $phoneNumber, 10));
     } else {
         $fields->push(new NumericField($this->name . '[Number]', '', $phoneNumber, 10));
     }
     if ($this->ext !== null) {
         $fields->push(new NumericField($this->name . '[Extension]', 'ext', $extension, 6));
     }
     $description = $this->getDescription();
     if ($description) {
         $fields->getChildren()->First()->setDescription($description);
     }
     foreach ($fields as $field) {
         $field->setDisabled($this->isDisabled());
         $field->setReadonly($this->isReadonly());
     }
     return $fields;
 }
开发者ID:congaaids,项目名称:silverstripe-framework,代码行数:32,代码来源:PhoneNumberField.php

示例3: Field

 public function Field()
 {
     $field = new FieldGroup($this->name);
     $field->setID("{$this->name}_Holder");
     $valueArr = array();
     list($valueArr['BankCode'], $valueArr['BranchCode'], $valueArr['AccountNumber'], $valueArr['AccountSuffix']) = explode(" ", $this->value);
     $valueArr = self::convert_format_nz($valueArr);
     $field->push(new NumericField($this->name . '[BankCode]', '', $valueArr['BankCode'], 2));
     $field->push(new NumericField($this->name . '[BranchCode]', '', $valueArr['BranchCode'], 4));
     $field->push(new NumericField($this->name . '[AccountNumber]', '', $valueArr['AccountNumber'], 8));
     $field->push(new NumericField($this->name . '[AccountSuffix]', '', $valueArr['AccountSuffix'], 3));
     return $field;
 }
开发者ID:ramziammar,项目名称:websites,代码行数:13,代码来源:BankAccountField.php

示例4: Field

 public function Field()
 {
     $field = new FieldGroup($this->name);
     $field->setID("{$this->name}_Holder");
     $valueArr = $this->valueArr;
     $valueArr = self::convert_format_nz($valueArr);
     $field->push($n1 = new NumericField($this->name . '[BankCode]', '', $valueArr['BankCode'], 2));
     $field->push($n2 = new NumericField($this->name . '[BranchCode]', '', $valueArr['BranchCode'], 4));
     $field->push($n3 = new NumericField($this->name . '[AccountNumber]', '', $valueArr['AccountNumber'], 8));
     $field->push($n4 = new NumericField($this->name . '[AccountSuffix]', '', $valueArr['AccountSuffix'], 3));
     if ($this->tabIndex) {
         $n1->setTabIndex($this->getTabIndex());
         $n2->setTabIndex($this->getTabIndex() + 1);
         $n3->setTabIndex($this->getTabIndex() + 2);
         $n4->setTabIndex($this->getTabIndex() + 3);
     }
     return $field;
 }
开发者ID:helpfulrobot,项目名称:silverstripe-formfields-nz,代码行数:18,代码来源:BankAccountField.php


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