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


PHP FormStateInterface::setProgrammed方法代码示例

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


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

示例1: setProgrammed

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

示例2: submitForm

 /**
  * {@inheritdoc}
  */
 public function submitForm($form_arg, FormStateInterface &$form_state)
 {
     $build_info = $form_state->getBuildInfo();
     if (empty($build_info['args'])) {
         $args = func_get_args();
         // Remove $form and $form_state from the arguments.
         unset($args[0], $args[1]);
         $form_state->addBuildInfo('args', array_values($args));
     }
     // Populate FormState::$input with the submitted values before retrieving
     // the form, to be consistent with what self::buildForm() does for
     // non-programmatic submissions (form builder functions may expect it to be
     // there).
     $form_state->setUserInput($form_state->getValues());
     $form_state->setProgrammed();
     $form_id = $this->getFormId($form_arg, $form_state);
     $form = $this->retrieveForm($form_id, $form_state);
     // Programmed forms are always submitted.
     $form_state->setSubmitted();
     // Reset form validation.
     $form_state->setValidationEnforced();
     $form_state->clearErrors();
     $this->prepareForm($form_id, $form, $form_state);
     $this->processForm($form_id, $form, $form_state);
 }
开发者ID:komejo,项目名称:article-test,代码行数:28,代码来源:FormBuilder.php

示例3: testSetProgrammed

 /**
  * @covers ::setProgrammed
  *
  * @dataProvider providerSingleBooleanArgument
  *
  * @param bool $programmed
  */
 public function testSetProgrammed($programmed)
 {
     $this->decoratedFormState->setProgrammed($programmed)->shouldBecalled();
     $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setProgrammed($programmed));
 }
开发者ID:eigentor,项目名称:tommiblog,代码行数:12,代码来源:FormStateDecoratorBaseTest.php


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