Elgg  Version master
comments.php
Go to the documentation of this file.
1 <?php
9 $entity = elgg_extract('entity', $vars);
10 if (!$entity instanceof ElggEntity) {
11  return;
12 }
13 
14 $limit = elgg_extract('limit', $vars, get_input('limit', 0));
15 if (!$limit) {
17 }
18 
19 echo elgg_list_entities([
20  'type' => 'object',
21  'subtype' => 'comment',
22  'container_guid' => $entity->guid,
23  'reverse_order_by' => true,
24  'full_view' => true,
25  'limit' => $limit,
26  'distinct' => false,
27  'metadata_name_value_pairs' => ['level' => 1],
28 ]);
elgg_comments_per_page(\ElggEntity $container=null)
How many comments appear per page.
$entity
Definition: comments.php:16
get_input(string $variable, $default=null, bool $filter_result=true)
Parameter input functions.
Definition: input.php:20
elgg_extract($key, $array, $default=null, bool $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:254
elgg_list_entities(array $options=[], callable $getter=null, callable $viewer=null)
Returns a string of rendered entities.
Definition: entities.php:549
$vars
Definition: theme.php:5
$limit
Definition: comments.php:25