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