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


PHP ReadonlyField::setForm方法代码示例

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


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

示例1: performReadonlyTransformation

 /**
  * Makes a pretty readonly field with some stars in it
  */
 function performReadonlyTransformation()
 {
     $stars = '*****';
     $field = new ReadonlyField($this->name, $this->title ? $this->title : '', $stars);
     $field->setForm($this->form);
     return $field;
 }
开发者ID:ramziammar,项目名称:websites,代码行数:10,代码来源:PasswordField.php

示例2: Field

 public function Field($properties = array())
 {
     $titleArray = $itemIDs = array();
     $titleList = $itemIDsList = "";
     if ($items = $this->getItems()) {
         foreach ($items as $item) {
             $titleArray[] = $item->Title;
         }
         foreach ($items as $item) {
             $itemIDs[] = $item->ID;
         }
         if ($titleArray) {
             $titleList = implode(", ", $titleArray);
         }
         if ($itemIDs) {
             $itemIDsList = implode(",", $itemIDs);
         }
     }
     $field = new ReadonlyField($this->name . '_ReadonlyValue', $this->title);
     $field->setValue($titleList);
     $field->setForm($this->form);
     $valueField = new HiddenField($this->name);
     $valueField->setValue($itemIDsList);
     $valueField->setForm($this->form);
     return $field->Field() . $valueField->Field();
 }
开发者ID:SpiritLevel,项目名称:silverstripe-framework,代码行数:26,代码来源:TreeMultiselectField_Readonly.php

示例3: performReadonlyTransformation

 /**
  * Returns a readonly version of this field
  */
 function performReadonlyTransformation()
 {
     $field = new ReadonlyField($this->name, $this->title, $this->value);
     $field->addExtraClass($this->extraClass());
     $field->setForm($this->form);
     return $field;
 }
开发者ID:helpfulrobot,项目名称:sheadawson-silverstripe-dynamiclists,代码行数:10,代码来源:DependentDynamicListDropdownField.php

示例4: performReadonlyTransformation

 /**
  * Transforms the source data for this CheckboxSetField
  * into a comma separated list of values.
  *
  * @return ReadonlyField
  */
 public function performReadonlyTransformation()
 {
     $values = '';
     $data = array();
     $items = $this->value;
     if ($this->source) {
         foreach ($this->source as $source) {
             if (is_object($source)) {
                 $sourceTitles[$source->ID] = $source->Title;
             }
         }
     }
     if ($items) {
         // Items is a DO Set
         if (is_a($items, 'DataObjectSet')) {
             foreach ($items as $item) {
                 $data[] = $item->Title;
             }
             if ($data) {
                 $values = implode(', ', $data);
             }
             // Items is an array or single piece of string (including comma seperated string)
         } else {
             if (!is_array($items)) {
                 $items = preg_split('/ *, */', trim($items));
             }
             foreach ($items as $item) {
                 if (is_array($item)) {
                     $data[] = $item['Title'];
                 } elseif (is_array($this->source) && !empty($this->source[$item])) {
                     $data[] = $this->source[$item];
                 } elseif (is_a($this->source, 'DataObjectSet')) {
                     $data[] = $sourceTitles[$item];
                 } else {
                     $data[] = $item;
                 }
             }
             $values = implode(', ', $data);
         }
     }
     $title = $this->title ? $this->title : '';
     $field = new ReadonlyField($this->name, $title, $values);
     $field->setForm($this->form);
     return $field;
 }
开发者ID:huyby,项目名称:silverstripe-multivaluefield,代码行数:51,代码来源:MultiValueCheckboxField.php

示例5: performReadonlyTransformation

 /**
  * Makes a pretty readonly field with some stars in it
  */
 public function performReadonlyTransformation()
 {
     $stars = '*****';
     $field = new ReadonlyField($this->name, $this->title ? $this->title : _t('Member.PASSWORD'), $stars);
     $field->setForm($this->form);
     return $field;
 }
开发者ID:normann,项目名称:sapphire,代码行数:10,代码来源:ConfirmedPasswordField.php

示例6: performReadonlyTransformation

 /**
  * Makes a pretty readonly field
  */
 function performReadonlyTransformation()
 {
     $values = '';
     $items = $this->value;
     foreach ($this->source as $source) {
         if (is_object($source)) {
             $sourceTitles[$source->ID] = $source->Title;
         }
     }
     if ($items) {
         // Items is a DO Set
         if (is_a($items, 'DataObjectSet')) {
             foreach ($items as $item) {
                 $data[] = $item->Title;
             }
             if ($data) {
                 $values = implode(", ", $data);
             }
             // Items is an array or single piece of string (including comma seperated string)
         } else {
             if (!is_array($items)) {
                 $items = split(" *, *", trim($items));
             }
             foreach ($items as $item) {
                 if (is_array($item)) {
                     $data[] = $item['Title'];
                 } else {
                     if (is_array($this->source) && $this->source[$item]) {
                         $data[] = $this->source[$item];
                     } else {
                         if (is_a($this->source, "ComponentSet")) {
                             //added for editable checkboxset.
                             $data[] = $sourceTitles[$item];
                         } else {
                             $data[] = $item;
                         }
                     }
                 }
             }
             $values = implode(", ", $data);
         }
     }
     $field = new ReadonlyField($this->name, $this->title ? $this->title : "", $values);
     $field->setForm($this->form);
     return $field;
 }
开发者ID:ramziammar,项目名称:websites,代码行数:49,代码来源:CheckboxSetField.php

示例7: Field

 function Field()
 {
     $titleArray = array();
     $titleList = array();
     if ($items = $this->getItems()) {
         foreach ($items as $item) {
             $titleArray[] = $item->Title;
         }
         if ($titleArray) {
             $titleList = implode(", ", $titleArray);
         }
     }
     $field = new ReadonlyField($this->name, $this->title);
     $field->setValue($titleList);
     $field->setForm($this->form);
     return $field->Field();
 }
开发者ID:racontemoi,项目名称:shibuichi,代码行数:17,代码来源:TreeMultiselectField.php

示例8: performReadonlyTransformation

 /**
  * Return list of IDs for read only
  *
  * @return ReadonlyField
  */
 public function performReadonlyTransformation()
 {
     $values = implode(',', $this->getSelected());
     $field = new ReadonlyField($this->name, $this->title, $values);
     $field->setForm($this->form);
     return $field;
 }
开发者ID:swilsonalfa,项目名称:silverstripe-multiselectfield,代码行数:12,代码来源:MultiSelectField.php


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