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


PHP ConfigEntityListBuilder::getOperations方法代碼示例

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


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

示例1: getOperations

  /**
   * {@inheritdoc}
   */
  public function getOperations(EntityInterface $entity) {
    $operations = parent::getOperations($entity);
    // Place the edit operation after the operations added by field_ui.module
    // which have the weights 15, 20, 25.
    if (isset($operations['edit'])) {
      $operations['edit'] = [
        'title' => t('Edit'),
        'weight' => 30,
        'url' => $entity->urlInfo('edit-form')
      ];
    }
    if (isset($operations['delete'])) {
      $operations['delete'] = [
        'title' => t('Delete'),
        'weight' => 35,
        'url' => $entity->urlInfo('delete-form')
      ];
    }
    // Sort the operations to normalize link order.
    uasort($operations, [
      'Drupal\Component\Utility\SortArray',
      'sortByWeightElement'
    ]);

    return $operations;
  }
開發者ID:housineali,項目名稱:drpl8_dv,代碼行數:29,代碼來源:ProfileTypeListBuilder.php

示例2: getOperations

 /**
  * @inheritDoc
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     if (!empty($operations['edit'])) {
         /** @var \Drupal\Core\Url $edit */
         $edit = $operations['edit']['url'];
         $edit->setRouteParameters(['machine_name' => $entity->id(), 'step' => 'general']);
     }
     return $operations;
 }
開發者ID:Wylbur,項目名稱:gj,代碼行數:13,代碼來源:ExampleConfigEntityListBuilder.php

示例3: getOperations

 /**
  * {@inheritdoc}
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     // Global and entity defaults can be reverted but not deleted.
     if (strpos($entity->id(), '__') === FALSE) {
         unset($operations['delete']);
         $operations['revert'] = array('title' => t('Revert'), 'weight' => $operations['edit']['weight'] + 1, 'url' => $entity->urlInfo('revert-form'));
     }
     return $operations;
 }
開發者ID:darrylri,項目名稱:protovbmwmo,代碼行數:13,代碼來源:MetatagDefaultsListBuilder.php

示例4: getOperations

 /**
  * {@inheritdoc}
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     foreach (array_keys($operations) as $operation) {
         // This is a translation UI for translators. Show the translation
         // operation only.
         if (!($operation == 'translate')) {
             unset($operations[$operation]);
         }
     }
     return $operations;
 }
開發者ID:sarahwillem,項目名稱:OD8,代碼行數:15,代碼來源:ConfigTranslationEntityListBuilder.php

示例5: getOperations

 /**
  * {@inheritdoc}
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     $operations['delete']['href'] = 'admin/config/domain/alias/delete/' . $entity->id();
     return $operations;
 }
開發者ID:dropdog,項目名稱:play,代碼行數:9,代碼來源:DomainAliasListBuilder.php

示例6: getOperations

 /**
  * {@inheritdoc}
  */
 public function getOperations(EntityInterface $entity)
 {
     $operations = parent::getOperations($entity);
     if (isset($operations['translate'])) {
         unset($operations['translate']);
     }
     return $operations;
 }
開發者ID:jeroenos,項目名稱:jeroenos_d8.mypressonline.com,代碼行數:11,代碼來源:XmlSitemapListBuilder.php


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