Elgg  Version 2.3
container.php
Go to the documentation of this file.
1 <?php
11 $item = $vars['item'];
12 /* @var ElggEntity $item */
13 
14 $link = elgg_extract('link', $vars, true);
15 
16 $entity = $item->getContainerEntity();
17 if (!$entity) {
18  return;
19 }
20 
21 $value = $entity->getDisplayName();
22 if ($link) {
23  $value = elgg_view('output/url', [
24  'href' => $entity->getURL(),
25  'text' => $value,
26  ]);
27 }
28 
29 echo $value;
$entity
Definition: container.php:16
$link
Definition: container.php:14
$vars['entity']
elgg echo
Translates a string.
Definition: languages.js:48
elgg_view($view, $vars=array(), $ignore1=false, $ignore2=false, $viewtype= '')
Return a parsed view.
Definition: views.php:336
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:1375
$item
Render a container element.
Definition: container.php:11
if(!$entity) $value
Definition: container.php:21