當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。