Elgg  Version 3.0
section.php
Go to the documentation of this file.
1 <?php
2 
9 $section = elgg_extract('section', $vars);
11 
12 if ($section && elgg_view_exists("page/elements/$section/before")) {
13  echo elgg_view("page/elements/$section/before", $vars);
14 }
15 
16 if (!empty($html)) {
17  $class = ['elgg-page-section'];
18  if ($section) {
19  $class[] = "elgg-page-$section";
20  }
21 
22  $inner = elgg_format_element('div', [
23  'class' => 'elgg-inner',
24  ], $html);
25 
26  echo elgg_format_element('div', [
27  'class' => $class,
28  ], $inner);
29 }
30 
31 if ($section && elgg_view_exists("page/elements/$section/after")) {
32  echo elgg_view("page/elements/$section/after", $vars);
33 }
elgg_view_exists($view, $viewtype= '', $recurse=true)
Returns whether the specified view exists.
Definition: views.php:205
$html
Definition: section.php:10
$class
Definition: field.php:29
elgg_format_element($tag_name, array $attributes=[], $text= '', array $options=[])
Format an HTML element.
Definition: output.php:168
elgg echo
Translates a string.
Definition: languages.js:43
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:1131
elgg_view($view, $vars=[], $viewtype= '')
Return a parsed view.
Definition: views.php:246