Elgg  Version 2.3
time_created.php
Go to the documentation of this file.
1 <?php
11 $entity = $vars['item'];
12 /* @var ElggEntity $entity */
13 
14 $format = elgg_extract('format', $vars, 'M d, Y H:i');
15 
16 if ($format === 'friendly') {
17  echo elgg_view('output/friendlytime', [
18  'time' => $entity->time_created,
19  ]);
20  return;
21 }
22 
23 echo date($format, $entity->time_created);
$vars['entity']
$entity
Render the time created.
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
$format