Elgg  Version 3.0
container.php
Go to the documentation of this file.
1 <?php
12 if (!$item instanceof ElggEntity) {
13  return;
14 }
15 
16 $link = elgg_extract('link', $vars, true);
17 
18 $entity = $item->getContainerEntity();
19 if (!$entity) {
20  return;
21 }
22 
23 $value = $entity->getDisplayName();
24 if ($link) {
25  $value = elgg_view('output/url', [
26  'href' => $entity->getURL(),
27  'text' => $value,
28  ]);
29 }
30 
31 echo $value;
$entity
Definition: container.php:18
if(!$item instanceof ElggEntity) $link
Definition: container.php:16
elgg echo
Translates a string.
Definition: languages.js:43
elgg_extract($key, $array, $default=null, $strict=true)
Checks for $array[$key] and returns its value if it exists, else returns $default.
Definition: elgglib.php:1131
$item
Render a container element.
Definition: container.php:11
$vars['type']
Definition: save.php:11
if(!$entity) $value
Definition: container.php:23
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246