本文整理汇总了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例8: render
/**
* {@inheritdoc}
*/
public function render()
{
$build['description'] = array('#markup' => $this->t('Entity settings'));
$build['table'] = parent::render();
return $build;
}
示例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;
}
示例10: render
/**
* {@inheritdoc}
*/
public function render()
{
$build = parent::render();
$build['table']['#empty'] = $this->t('No people available.');
return $build;
}
示例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;
}
示例12: render
/**
* {@inheritdoc}
*/
public function render()
{
$build['accounts'] = parent::render();
$build['accounts']['#empty'] = $this->t('No people available.');
$build['pager']['#theme'] = 'pager';
return $build;
}