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


PHP FormStateInterface::setLimitValidationErrors方法代码示例

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


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

示例1: setLimitValidationErrors

 /**
  * {@inheritdoc}
  */
 public function setLimitValidationErrors($limit_validation_errors) {
   $add_subkeys = function(array $path) {
     return array_merge($this->subKeys, $path);
   };
   $limit_validation_errors = array_map($add_subkeys, $limit_validation_errors);
   $this->mainFormState->setLimitValidationErrors($limit_validation_errors);
   return $this;
 }
开发者ID:jkyto,项目名称:agolf,代码行数:11,代码来源:SubFormState.php

示例2: validateRequiredFields

 /**
  * Validate callback for alt and title field, if the user wants them required.
  *
  * This is separated in a validate function instead of a #required flag to
  * avoid being validated on the process callback.
  */
 public static function validateRequiredFields($element, FormStateInterface $form_state)
 {
     // Only do validation if the function is triggered from other places than
     // the image process form.
     if (!in_array('file_managed_file_submit', $form_state->getTriggeringElement()['#submit'])) {
         // If the image is not there, we do not check for empty values.
         $parents = $element['#parents'];
         $field = array_pop($parents);
         $image_field = NestedArray::getValue($form_state->getUserInput(), $parents);
         // We check for the array key, so that it can be NULL (like if the user
         // submits the form without using the "upload" button).
         if (!array_key_exists($field, $image_field)) {
             return;
         }
     } else {
         $form_state->setLimitValidationErrors([]);
     }
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:24,代码来源:ImageWidget.php

示例3: setLimitValidationErrors

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

示例4: testSetLimitValidationErrors

 /**
  * @covers ::setLimitValidationErrors
  *
  * @dataProvider providerLimitValidationErrors
  *
  * @param array[]|null $limit_validation_errors
  *   Any valid value for
  *   \Drupal\Core\Form\FormStateInterface::setLimitValidationErrors()'s
  *   $limit_validation_errors argument;
  */
 public function testSetLimitValidationErrors($limit_validation_errors)
 {
     $this->decoratedFormState->setLimitValidationErrors($limit_validation_errors)->shouldBecalled();
     $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setLimitValidationErrors($limit_validation_errors));
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:15,代码来源:FormStateDecoratorBaseTest.php


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