Elgg  Version 4.3
last_action.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->last_action,
21  ]);
22  return;
23 }
24 
25 echo elgg_view('output/date', [
26  'value' => $entity->last_action,
27  'format' => $format,
28 ]);
$entity
Render the last action timestamp.
Definition: last_action.php:11
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:547
elgg echo
Translates a string.
Definition: deprecated.js:530
$vars['head']
Definition: html.php:24
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179
if(!$entity instanceof\ElggEntity) $format
Definition: last_action.php:16