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


PHP FormStateInterface::addCleanValueKey方法代码示例

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


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

示例1: processVerticalTabs

 /**
  * Creates a group formatted as vertical tabs.
  *
  * @param array $element
  *   An associative array containing the properties and children of the
  *   details element.
  * @param \Drupal\Core\Form\FormStateInterface $form_state
  *   The current state of the form.
  * @param array $complete_form
  *   The complete form structure.
  *
  * @return array
  *   The processed element.
  */
 public static function processVerticalTabs(&$element, FormStateInterface $form_state, &$complete_form)
 {
     // Inject a new details as child, so that form_process_details() processes
     // this details element like any other details.
     $element['group'] = array('#type' => 'details', '#theme_wrappers' => array(), '#parents' => $element['#parents']);
     // Add an invisible label for accessibility.
     if (!isset($element['#title'])) {
         $element['#title'] = t('Vertical Tabs');
         $element['#title_display'] = 'invisible';
     }
     $element['#attached']['library'][] = 'core/drupal.vertical-tabs';
     // The JavaScript stores the currently selected tab in this hidden
     // field so that the active tab can be restored the next time the
     // form is rendered, e.g. on preview pages or when form validation
     // fails.
     $name = implode('__', $element['#parents']);
     if ($form_state->hasValue($name . '__active_tab')) {
         $element['#default_tab'] = $form_state->getValue($name . '__active_tab');
     }
     $element[$name . '__active_tab'] = array('#type' => 'hidden', '#default_value' => $element['#default_tab'], '#attributes' => array('class' => array('vertical-tabs-active-tab')));
     // Clean up the active tab value so it's not accidentally stored in
     // settings forms.
     $form_state->addCleanValueKey($name . '__active_tab');
     return $element;
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:39,代码来源:VerticalTabs.php

示例2: addCleanValueKey

 /**
  * {@inheritdoc}
  */
 public function addCleanValueKey($key)
 {
     $this->mainFormState->addCleanValueKey($key);
     return $this;
 }
开发者ID:Laudanum,项目名称:authorization,代码行数:8,代码来源:SubFormState.php

示例3: addCleanValueKey

 /**
  * {@inheritdoc}
  */
 public function addCleanValueKey($cleanValueKey)
 {
     $this->decoratedFormState->addCleanValueKey($cleanValueKey);
     return $this;
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:8,代码来源:FormStateDecoratorBase.php

示例4: cleanValue

 /**
  * Helper function to clean a value on an element.
  */
 public static function cleanValue(&$element, FormStateInterface $form_state, &$complete_form)
 {
     $form_state->addCleanValueKey('wine');
 }
开发者ID:penguinclub,项目名称:penguinweb_drupal8,代码行数:7,代码来源:FormTestFormStateValuesCleanForm.php

示例5: testAddCleanValueKey

 /**
  * @covers ::addCleanValueKey
  */
 public function testAddCleanValueKey()
 {
     $key = 'BAR';
     $this->decoratedFormState->addCleanValueKey($key)->shouldBeCalled();
     $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->addCleanValueKey($key));
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:9,代码来源:FormStateDecoratorBaseTest.php


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