當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。