Elgg  Version 4.3
prev_last_login.php
Go to the documentation of this file.
1 <?php
12 if (!$entity instanceof \ElggUser) {
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->prev_last_login,
21  ]);
22  return;
23 }
24 
25 echo elgg_view('output/date', [
26  'value' => $entity->prev_last_login,
27  'format' => $format,
28 ]);
$entity
Render the prev last login timestamp.
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
if(!$entity instanceof\ElggUser) $format
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:179