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


PHP EntityForm::actions方法代码示例

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


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

示例1: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = t('Save bundle');
     $actions['delete']['#value'] = t('Delete bundle');
     return $actions;
 }
开发者ID:jokas,项目名称:d8.dev,代码行数:10,代码来源:EckEntityBundleForm.php

示例2: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save contact type');
     $actions['delete']['#title'] = $this->t('Delete contact type');
     return $actions;
 }
开发者ID:jasonruyle,项目名称:crm_core,代码行数:10,代码来源:ContactTypeForm.php

示例3: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     if ($this->entity->isNew()) {
         $actions['submit']['#value'] = $this->t('Save and edit');
     }
     return $actions;
 }
开发者ID:r-daneelolivaw,项目名称:chalk,代码行数:11,代码来源:WrapperEntityForm.php

示例4: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     // Get the basic actions from the base class.
     $actions = parent::actions($form, $form_state);
     // Change the submit button text.
     $actions['submit']['#value'] = $this->t('Save');
     return $actions;
 }
开发者ID:jokas,项目名称:d8.dev,代码行数:11,代码来源:EckEntityTypeFormBase.php

示例5: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->getConfirmText();
     unset($actions['delete']);
     // Prepare cancel link.
     $actions['cancel'] = ConfirmFormHelper::buildCancelLink($this, $this->getRequest());
     return $actions;
 }
开发者ID:anatalsceo,项目名称:en-classe,代码行数:12,代码来源:EntityConfirmFormBase.php

示例6: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $form = parent::actions($form, $form_state);
     // We want to display the button only on add page.
     if ($this->entity->isNew() && \Drupal::moduleHandler()->moduleExists('field_ui')) {
         $form['submit']['#value'] = $this->t('Save and manage fields');
     }
     return $form;
 }
开发者ID:eric-shell,项目名称:eric-shell-d8,代码行数:12,代码来源:ParagraphsTypeForm.php

示例7: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     if (\Drupal::moduleHandler()->moduleExists('field_ui') && $this->getEntity()->isNew()) {
         $actions['save_continue'] = $actions['submit'];
         $actions['save_continue']['#value'] = t('Save and manage fields');
         $actions['save_continue']['#submit'][] = [$this, 'redirectToFieldUI'];
     }
     return $actions;
 }
开发者ID:darrylri,项目名称:protovbmwmo,代码行数:13,代码来源:ProfileTypeForm.php

示例8: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     // If we are displaying the delete confirmation skip the regular actions.
     if (!$form_state->get('confirm_delete')) {
         $actions = parent::actions($form, $form_state);
         // We cannot leverage the regular submit handler definition because we
         // have button-specific ones here. Hence we need to explicitly set it for
         // the submit action, otherwise it would be ignored.
         if ($this->moduleHandler->moduleExists('content_translation')) {
             array_unshift($actions['submit']['#submit'], 'content_translation_language_configuration_element_submit');
         }
         return $actions;
     } else {
         return array();
     }
 }
开发者ID:nstielau,项目名称:drops-8,代码行数:19,代码来源:VocabularyForm.php

示例9: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->t('Save settings');
     if (!$this->entity->isNew()) {
         $target_entity_type = $this->entityManager->getDefinition($this->entity->getTargetEntityTypeId());
         $route_parameters = ['field_config' => $this->entity->id()] + FieldUI::getRouteBundleParameter($target_entity_type, $this->entity->bundle);
         $url = new Url('entity.field_config.' . $target_entity_type->id() . '_field_delete_form', $route_parameters);
         if ($this->getRequest()->query->has('destination')) {
             $query = $url->getOption('query');
             $query['destination'] = $this->getRequest()->query->get('destination');
             $url->setOption('query', $query);
         }
         $actions['delete'] = array('#type' => 'link', '#title' => $this->t('Delete'), '#url' => $url, '#access' => $this->entity->access('delete'), '#attributes' => array('class' => array('button', 'button--danger')));
     }
     return $actions;
 }
开发者ID:brstde,项目名称:gap1,代码行数:20,代码来源:FieldConfigEditForm.php

示例10: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     /* @var $search_api_page \Drupal\search_api_page\SearchApiPageInterface */
     $search_api_page = $this->entity;
     if ($search_api_page->isNew()) {
         $actions['submit']['#value'] = $this->t('Next');
     }
     $default_index = $search_api_page->getIndex();
     if (!empty($default_index)) {
         // Add an update button that shows up when changing the index.
         $default_index_states_invisible = array('invisible' => array(':input[name="index"]' => array('value' => $default_index)));
         $actions['update'] = $actions['submit'];
         $actions['update']['#value'] = $this->t('Update');
         $actions['update']['#states'] = $default_index_states_invisible;
         // Hide the Save button when the index changes.
         $default_index_states_visible = array('visible' => array(':input[name="index"]' => array('value' => $default_index)));
         $actions['submit']['#states'] = $default_index_states_visible;
     }
     return $actions;
 }
开发者ID:nB-MDSO,项目名称:mdso-d8blog,代码行数:24,代码来源:SearchApiPageForm.php

示例11: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, array &$form_state)
 {
     // If we are displaying the delete confirmation skip the regular actions.
     if (empty($form_state['confirm_delete'])) {
         $actions = parent::actions($form, $form_state);
         // Add the language configuration submit handler. This is needed because
         // the submit button has custom submit handlers.
         if ($this->moduleHandler->moduleExists('language')) {
             array_unshift($actions['submit']['#submit'], 'language_configuration_element_submit');
             array_unshift($actions['submit']['#submit'], array($this, 'languageConfigurationSubmit'));
         }
         // We cannot leverage the regular submit handler definition because we
         // have button-specific ones here. Hence we need to explicitly set it for
         // the submit action, otherwise it would be ignored.
         if ($this->moduleHandler->moduleExists('content_translation')) {
             array_unshift($actions['submit']['#submit'], 'content_translation_language_configuration_element_submit');
         }
         return $actions;
     } else {
         return array();
     }
 }
开发者ID:alnutile,项目名称:drunatra,代码行数:25,代码来源:VocabularyForm.php

示例12: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     // Change the submit button text.
     $actions['submit']['#value'] = $this->t('Save');
     $actions['submit']['#suffix'] = $this->l($this->t('Cancel'), $this->getCancelUrl());
     return $actions;
 }
开发者ID:pedrocones,项目名称:hydrotools,代码行数:11,代码来源:TaxRateFormBase.php

示例13: actions

  /**
   * {@inheritdoc}
   */
  protected function actions(array $form, FormStateInterface $form_state) {
    $actions = parent::actions($form, $form_state);

    // We don't have a "delete" action here.
    unset($actions['delete']);

    return $actions;
  }
开发者ID:jkyto,项目名称:agolf,代码行数:11,代码来源:IndexProcessorsForm.php

示例14: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['submit']['#value'] = $this->entity->isNew() ? $this->t('Add ball') : $this->t('Update ball');
     return $actions;
 }
开发者ID:jacerider,项目名称:Sample-Config-Entity,代码行数:9,代码来源:BallForm.php

示例15: actions

 /**
  * {@inheritdoc}
  */
 protected function actions(array $form, FormStateInterface $form_state)
 {
     $actions = parent::actions($form, $form_state);
     $actions['delete']['#access'] = FALSE;
     return $actions;
 }
开发者ID:pedrocones,项目名称:hydrotools,代码行数:9,代码来源:CountryForm.php


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