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


PHP EntityListBuilder::render方法代碼示例

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


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

示例1: render

 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $build = parent::render();
     // Override the empty text.
     $build['table']['#empty'] = $this->t('There are no @label entities yet.', ['@label' => $this->entityType->getLabel()]);
     return $build;
 }
開發者ID:heddn,項目名稱:content_entity_base,代碼行數:10,代碼來源:EntityBaseListBuilder.php

示例2: render

 /**
  * {@inheritdoc}
  *
  * @param EntityInterface $event
  *   The event entity to display registrations.
  */
 public function render(EntityInterface $event = NULL)
 {
     if (isset($event)) {
         $this->event = $event;
     }
     $render = parent::render();
     $render['table']['#empty'] = t('No registrations found for this event.');
     return $render;
 }
開發者ID:justincletus,項目名稱:webdrupalpro,代碼行數:15,代碼來源:RegistrationListBuilder.php

示例3: render

 /**
  * {@inheritdoc}
  *
  * @param EntityInterface $event
  *   The event entity to display registrations.
  */
 public function render(EntityInterface $event = NULL)
 {
     if (isset($event)) {
         $this->event = $event;
     }
     drupal_set_message($this->t('This rule list is for advanced users. Take care when committing any actions from this page.'), 'warning');
     $render = parent::render();
     $render['table']['#empty'] = t('No rules found for this event.');
     return $render;
 }
開發者ID:justincletus,項目名稱:webdrupalpro,代碼行數:16,代碼來源:RuleListBuilder.php

示例4: render

 /**
  * {@inheritdoc}
  *
  * @param EntityInterface $event
  *   The event entity to display registrations.
  */
 public function render(EntityInterface $event = NULL)
 {
     if (isset($event)) {
         $this->event = $event;
     }
     $render['description'] = ['#prefix' => '<p>', '#markup' => $this->t('Groups allow you to organize registrations. Some pre-made groups are automatically applied to registrations.'), '#suffix' => '</p>'];
     $render = parent::render();
     $render['table']['#empty'] = t('No groups found for this event.');
     return $render;
 }
開發者ID:justincletus,項目名稱:webdrupalpro,代碼行數:16,代碼來源:GroupListBuilder.php

示例5: render

 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $table = parent::render();
     $filter = $this->getFilterLabels();
     usort($table['#rows'], array($this, 'sortRows'));
     $build['filters'] = array('#type' => 'container', '#attributes' => array('class' => array('table-filter', 'js-show')));
     $build['filters']['text'] = array('#type' => 'search', '#title' => $this->t('Search'), '#size' => 30, '#placeholder' => $filter['placeholder'], '#attributes' => array('class' => array('table-filter-text'), 'data-table' => '.config-translation-entity-list', 'autocomplete' => 'off', 'title' => $filter['description']));
     $build['table'] = $table;
     $build['table']['#attributes']['class'][] = 'config-translation-entity-list';
     $build['#attached']['library'][] = 'system/drupal.system.modules';
     return $build;
 }
開發者ID:davidsoloman,項目名稱:drupalconsole.com,代碼行數:15,代碼來源:ConfigTranslationEntityListBuilder.php

示例6: render

 /**
  * {@inheritdoc}
  *
  * We override ::render() so that we can add our own content above the table.
  * parent::render() is where EntityListBuilder creates the table using our
  * buildHeader() and buildRow() implementations.
  */
 public function render()
 {
     /** @var RdfEntitySparqlStorage $storage */
     $storage = $this->storage;
     $definitions = $storage->getGraphDefinitions();
     if (count($definitions)) {
         $options = [];
         foreach ($definitions as $name => $definition) {
             $options[$name] = $definition['title'];
         }
         // Embed the graph selection form.
         $form = \Drupal::formBuilder()->getForm('Drupal\\rdf_entity\\Form\\GraphSelectForm', $options);
         if ($form) {
             $build['graph_form'] = $form;
         }
     }
     $build['table'] = parent::render();
     return $build;
 }
開發者ID:ec-europa,項目名稱:joinup-dev,代碼行數:26,代碼來源:RdfListBuilder.php

示例7: render

 /**
  * {@inheritdoc}
  *
  * Builds the entity listing as renderable array for table.html.twig.
  *
  * @todo Add a link to add a new item to the #empty text.
  */
 public function render()
 {
     $build = array();
     // @todo d8-port: get pager working.
     $this->limit = \Drupal::config('workflow.settings')->get('workflow_states_per_page');
     // TODO D8-port
     // $output .= theme('pager', array('tags' => $limit)); // TODO D8-port
     // @todo d8-port: get core title working: $build['table']['#title'] by getTitle() is not working.
     $build['workflow_list_title'] = array('#markup' => $this->getTitle());
     $build += parent::render();
     // Add a footer. This is not yet added in EntityListBilder::render()
     if ($this->footer_needed) {
         // TODO D8-port: test this.
         // Two variants. First variant is official, but I like 2nd better.
         /*
           $build['table']['#footer'] = array(
             array(
               'class' => array('footer-class'),
               'data' => array(
                 array(
                   'data' => WORKFLOW_MARK_STATE_IS_DELETED . ' ' . t('State is no longer available.'),
                   'colspan' => count($build['table']['#header']),
                 ),
               ),
             ),
           );
         */
         $build['workflow_footer'] = array('#markup' => WORKFLOW_MARK_STATE_IS_DELETED . ' ' . t('State is no longer available.'), '#weight' => 500);
     }
     return $build;
 }
開發者ID:sedurzu,項目名稱:ildeposito8,代碼行數:38,代碼來源:WorkflowTransitionListBuilder.php

示例8: render

 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $build['description'] = array('#markup' => $this->t('Entity settings'));
     $build['table'] = parent::render();
     return $build;
 }
開發者ID:jokas,項目名稱:d8.dev,代碼行數:9,代碼來源:EckEntityListBuilder.php

示例9: render

 /**
  * {@inheritdoc}
  *
  * We override ::render() so that we can add our own content above the table.
  * parent::render() is where EntityListBuilder creates the table using our
  * buildHeader() and buildRow() implementations.
  */
 public function render()
 {
     $build['description'] = array('#markup' => $this->t('Content Entity Example implements a Reservation model. These reservations are not fieldable entities. You can manage the fields on the <a href="@adminlink">Reservation admin page</a>.', array('@adminlink' => \Drupal::urlGenerator()->generateFromRoute('entity.reservation.list'))));
     $build['table'] = parent::render();
     return $build;
 }
開發者ID:wallecan,項目名稱:drupalpp,代碼行數:13,代碼來源:ReservationListBuilder.php

示例10: render

 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $build = parent::render();
     $build['table']['#empty'] = $this->t('No people available.');
     return $build;
 }
開發者ID:ddrozdik,項目名稱:dmaps,代碼行數:9,代碼來源:UserListBuilder.php

示例11: render

 /**
  * {@inheritdoc}
  *
  * We override ::render() so that we can add our own content above the table.
  * parent::render() is where EntityListBuilder creates the table using our
  * buildHeader() and buildRow() implementations.
  */
 public function render()
 {
     $build['description'] = array('#markup' => $this->t('Content Entity Example implements a Contacts model. These contacts are fieldable entities. You can manage the fields on the <a href="@adminlink">Contacts admin page</a>.', array('@adminlink' => $this->urlGenerator->generateFromRoute('content_entity_example.contact_settings'))));
     $build['table'] = parent::render();
     return $build;
 }
開發者ID:dropdog,項目名稱:play,代碼行數:13,代碼來源:ContactListBuilder.php

示例12: render

 /**
  * {@inheritdoc}
  */
 public function render()
 {
     $build['accounts'] = parent::render();
     $build['accounts']['#empty'] = $this->t('No people available.');
     $build['pager']['#theme'] = 'pager';
     return $build;
 }
開發者ID:shumer,項目名稱:blog,代碼行數:10,代碼來源:UserListBuilder.php


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