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


PHP Form::getFields方法代码示例

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


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

示例1: processFormForTable

 /**
  * @param string $table
  * @param Form $form
  */
 protected function processFormForTable($table, Form $form)
 {
     $extensionName = $form->getExtensionName();
     $extensionKey = ExtensionNamingUtility::getExtensionKey($extensionName);
     $tableConfiguration = self::$tableTemplate;
     $fields = array();
     $labelFields = $form->getOption(Form::OPTION_TCA_LABELS);
     $enableColumns = array();
     foreach ($form->getFields() as $field) {
         $name = $field->getName();
         // note: extracts the TCEforms sub-array from the configuration, as required in TCA.
         $fields[$name] = array_pop($field->build());
     }
     if (TRUE === $form->getOption(Form::OPTION_TCA_HIDE)) {
         $enableColumns['disabled'] = 'hidden';
     }
     if (TRUE === $form->getOption(Form::OPTION_TCA_START)) {
         $enableColumns['start'] = 'starttime';
     }
     if (TRUE === $form->getOption(Form::OPTION_TCA_END)) {
         $enableColumns['end'] = 'endtime';
     }
     if (TRUE === $form->getOption(Form::OPTION_TCA_FEGROUP)) {
         $enableColumns['fe_group'] = 'fe_group';
     }
     $tableConfiguration['iconfile'] = ExtensionManagementUtility::extRelPath($extensionKey) . $form->getOption(Form::OPTION_ICON);
     $tableConfiguration['enablecolumns'] = $enableColumns;
     $tableConfiguration['title'] = $form->getLabel();
     $tableConfiguration['languageField'] = 'sys_language_uid';
     $showRecordsFieldList = $this->buildShowItemList($form);
     $GLOBALS['TCA'][$table] = array('ctrl' => $tableConfiguration, 'interface' => array('showRecordFieldList' => implode(',', array_keys($fields))), 'columns' => $fields, 'types' => array(0 => array('showitem' => $showRecordsFieldList)));
     if (TRUE === $form->getOption(Form::OPTION_TCA_DELETE)) {
         $GLOBALS['TCA'][$table]['ctrl']['delete'] = 'deleted';
     }
     if (NULL === $labelFields) {
         reset($fields);
         $GLOBALS['TCA'][$table]['ctrl']['label'] = key($fields);
     } else {
         $GLOBALS['TCA'][$table]['ctrl']['label'] = array_shift($labelFields);
         $GLOBALS['TCA'][$table]['ctrl']['label_alt'] = implode(',', $labelFields);
     }
 }
开发者ID:busynoggin,项目名称:flux,代码行数:46,代码来源:TableConfigurationPostProcessor.php

示例2: setDefaultValuesInFieldsWithInheritedValues

 /**
  * @param Form $form
  * @param array $row
  * @return Form
  */
 protected function setDefaultValuesInFieldsWithInheritedValues(Form $form, array $row)
 {
     foreach ($form->getFields() as $field) {
         $name = $field->getName();
         $inheritedValue = $this->getInheritedPropertyValueByDottedPath($row, $name);
         if (NULL !== $inheritedValue && TRUE === $field instanceof FieldInterface) {
             $field->setDefault($inheritedValue);
         }
     }
     return $form;
 }
开发者ID:samuweiss,项目名称:TYPO3-Site,代码行数:16,代码来源:AbstractProvider.php

示例3: setDefaultValuesInFieldsWithInheritedValues

 /**
  * @param Form $form
  * @param array $row
  * @return Form
  */
 protected function setDefaultValuesInFieldsWithInheritedValues(Form $form, array $row)
 {
     $inheritedConfiguration = $this->getInheritedConfiguration($row);
     foreach ($form->getFields() as $field) {
         $name = $field->getName();
         $inheritedValue = $this->getInheritedPropertyValueByDottedPath($inheritedConfiguration, $name);
         if (null !== $inheritedValue && true === $field instanceof Form\FieldInterface) {
             $field->setDefault($inheritedValue);
         }
     }
     return $form;
 }
开发者ID:fluidtypo3,项目名称:fluidpages,代码行数:17,代码来源:PageProvider.php


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