當前位置: 首頁>>代碼示例>>PHP>>正文


PHP FormStateInterface::setTemporary方法代碼示例

本文整理匯總了PHP中Drupal\Core\Form\FormStateInterface::setTemporary方法的典型用法代碼示例。如果您正苦於以下問題:PHP FormStateInterface::setTemporary方法的具體用法?PHP FormStateInterface::setTemporary怎麽用?PHP FormStateInterface::setTemporary使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Drupal\Core\Form\FormStateInterface的用法示例。


在下文中一共展示了FormStateInterface::setTemporary方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: buildForm

 /**
  * {@inheritdoc}
  */
 public function buildForm(array $form, FormStateInterface $form_state, $condition_id = NULL, $contexts = [])
 {
     $this->condition = $this->prepareCondition($condition_id);
     $temporary = $form_state->getTemporary();
     $temporary['gathered_contexts'] = $contexts;
     $form_state->setTemporary($temporary);
     // Allow the condition to add to the form.
     $form['condition'] = $this->condition->buildConfigurationForm([], $form_state);
     $form['condition']['#tree'] = TRUE;
     $form['actions'] = ['#type' => 'actions'];
     $form['actions']['submit'] = ['#type' => 'submit', '#value' => $this->submitButtonText(), '#button_type' => 'primary'];
     return $form;
 }
開發者ID:nB-MDSO,項目名稱:mdso-d8blog,代碼行數:16,代碼來源:ConditionFormBase.php

示例2: setTemporary

 /**
  * {@inheritdoc}
  */
 public function setTemporary(array $temporary)
 {
     $this->mainFormState->setTemporary($temporary);
     return $this;
 }
開發者ID:Laudanum,項目名稱:authorization,代碼行數:8,代碼來源:SubFormState.php

示例3: testSetTemporary

 /**
  * @covers ::setTemporary
  */
 public function testSetTemporary()
 {
     $temporary = ['FOO' => 'BAR'];
     $this->decoratedFormState->setTemporary($temporary)->shouldBeCalled();
     $this->assertSame($this->formStateDecoratorBase, $this->formStateDecoratorBase->setTemporary($temporary));
 }
開發者ID:eigentor,項目名稱:tommiblog,代碼行數:9,代碼來源:FormStateDecoratorBaseTest.php


注:本文中的Drupal\Core\Form\FormStateInterface::setTemporary方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。