Elgg  Version master
title.php
Go to the documentation of this file.
1 <?php
9 $title = elgg_extract('title', $vars);
10 if ($title === false) {
11  return;
12 }
13 
14 $title = (string) $title;
15 $entity = elgg_extract('entity', $vars);
16 if ($title === '' && $entity instanceof \ElggEntity) {
17  $title = elgg_get_excerpt($entity->getDisplayName(), 100);
18  if (elgg_is_empty($title)) {
19  return;
20  }
21 
22  $href = $entity->getURL();
23  if (!empty($href)) {
25  }
26 }
27 
29  return;
30 }
31 
32 echo elgg_format_element('div', ['class' => 'elgg-listing-summary-title'], $title);
$title
Output annotation title.
Definition: title.php:9
elgg_get_excerpt(string $text, int $num_chars=250)
Returns an excerpt.
Definition: output.php:83
elgg_is_empty($value)
Check if a value isn&#39;t empty, but allow 0 and &#39;0&#39;.
Definition: input.php:176
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
$entity
Definition: title.php:15
$vars
Definition: theme.php:5
elgg_view_url(string $href, string $text=null, array $options=[])
Helper function for outputting urls.
Definition: views.php:1427
elgg_format_element(string $tag_name, array $attributes=[], string $text= '', array $options=[])
Format an HTML element.
Definition: output.php:145