本文整理匯總了PHP中Drupal\Core\Entity\EntityForm::init方法的典型用法代碼示例。如果您正苦於以下問題:PHP EntityForm::init方法的具體用法?PHP EntityForm::init怎麽用?PHP EntityForm::init使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Drupal\Core\Entity\EntityForm
的用法示例。
在下文中一共展示了EntityForm::init方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: init
/**
* {@inheritdoc}
*/
public function init(FormStateInterface $form_state)
{
parent::init($form_state);
// @todo Remove the need for this.
$form_state->loadInclude('views_ui', 'inc', 'admin');
$form_state->set('view', $this->entity);
}
示例2: init
/**
* {@inheritdoc}
*/
protected function init(FormStateInterface $form_state)
{
parent::init($form_state);
$form_state->set(['entity_browser', 'instance_uuid'], \Drupal::service('uuid')->generate());
$form_state->set(['entity_browser', 'selected_entities'], []);
$form_state->set(['entity_browser', 'selection_completed'], FALSE);
}
示例3: init
/**
* Initialize the form state and the entity before the first form build.
*/
protected function init(FormStateInterface $form_state)
{
// Ensure we act on the translation object corresponding to the current form
// language.
$langcode = $this->getFormLangcode($form_state);
$this->entity = $this->entity->getTranslation($langcode);
$form_display = EntityFormDisplay::collectRenderDisplay($this->entity, $this->getOperation());
$this->setFormDisplay($form_display, $form_state);
parent::init($form_state);
}
示例4: init
/**
* {@inheritdoc}
*/
public function init(FormStateInterface $form_state)
{
parent::init($form_state);
if ($display_id = \Drupal::request()->attributes->get('display_id')) {
$this->displayID = $display_id;
}
// @todo Remove the need for this.
form_load_include($form_state, 'inc', 'views_ui', 'admin');
$form_state->set('view', $this->entity);
}
示例5: init
/**
* {@inheritdoc}
*/
protected function init(FormStateInterface $form_state)
{
parent::init($form_state);
$this->entityType = $this->entityManager->getDefinition($this->entity->getEntityTypeId());
}
示例6: init
/**
* {@inheritdoc}
*/
protected function init(array &$form_state)
{
parent::init($form_state);
$this->entityType = $this->entityManager->getDefinition($this->entity->getEntityTypeId());
}