Elgg  Version master
responses.php
Go to the documentation of this file.
1 <?php
2 
10 if (!elgg_extract('show_responses', $vars, true)) {
11  return;
12 }
13 
14 $entity = elgg_extract('entity', $vars);
15 
16 $responses = elgg_extract('responses', $vars);
17 if ($responses === null && ($entity instanceof \ElggEntity)) {
18  $responses = elgg_view_comments($entity, (bool) elgg_extract('show_add_form', $vars, true));
19 }
20 
21 if (empty($responses)) {
22  return;
23 }
24 
25 echo elgg_format_element('div', ['class' => 'elgg-listing-full-responses'], $responses);
$responses
Definition: responses.php:16
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
if(!elgg_extract('show_responses', $vars, true)) $entity
Outputs responses.
Definition: responses.php:14
$vars
Definition: theme.php:5
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145
elgg_view_comments(\ElggEntity $entity, bool $add_comment=true, array $vars=[])
Returns rendered comments and a comment form for an entity.
Definition: views.php:856