Elgg  Version master
time_updated.php
Go to the documentation of this file.
1 <?php
12 if (!$entity instanceof ElggEntity) {
13  return;
14 }
15 
16 $format = elgg_extract('format', $vars, DATE_RFC2822);
17 
18 if ($format === 'friendly') {
19  echo elgg_view('output/friendlytime', [
20  'time' => $entity->time_updated,
21  ]);
22  return;
23 }
24 
25 echo elgg_view('output/date', [
26  'value' => $entity->time_updated,
27  'format' => $format,
28 ]);
if(!$entity instanceof ElggEntity) $format
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_view(string $view, array $vars=[], string $viewtype= '')
Return a parsed view.
Definition: views.php:156
$entity
Render the time updated.
$vars
Definition: theme.php:5