本文整理汇总了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());
}