Elgg  Version 3.0
Variables
tabs.php File Reference

Go to the source code of this file.

Variables

 $id = elgg_extract('id', $vars)
 Tabbed module component Provides support for inline and ajax tabbing. More...
 
if(!isset($vars['id'])) $vars ['id'] = $id
 
 $vars ['class'] = elgg_extract_class($vars, 'elgg-tabs-component')
 
 $tabs = (array) elgg_extract('tabs', $vars, [])
 
if(empty($tabs)) $content = ''
 
 $module = elgg_extract('module', $vars, 'tabs')
 

Variable Documentation

$content = ''

Definition at line 47 of file tabs.php.

$id = elgg_extract('id', $vars)

Tabbed module component Provides support for inline and ajax tabbing.

$vars['id'] Optional ID of the module $vars['class'] Additional classes $vars['module'] Module name Defaults to 'tabs' (.elgg-module-tabs) $vars['tabs'] An array of tabs suitable for 'navigation/tabs' view Each tab should specify either:

  • a 'href' parameter to load content via AJAX, or
  • a 'content' parameter to display content inline If the tab uses a 'href' attribute, it should specify whether the contents should be reloaded on a subsequent click via 'data-ajax-reload' parameter; by default, all tabs will be reloading on subsequent clicks. You can pass additional data to the ajax view via data-ajax-query attribute (json encoded string). You can also set the data-ajax-href parameter of the tab, which will override the href parameter, in case you want to ensure the tab is clickable even before the JS is bootstrapped. [ ['text' => 'Tab 1', 'href' => '/dynamic', 'data-ajax-reload' => true], ['text' => 'Tab 2', 'href' => '/static', 'data-ajax-reload' => false], ['text' => 'Tab 3', 'href' => '/static', 'data-ajax-reload' => false, 'data-ajax-query' => json_encode($data)], ['text' => 'Tab 3', 'href' => '/page', 'data-ajax-href' => '/ajax/page'], ['text' => 'Tab 4', 'content' => 'Tab content'], ]

Definition at line 33 of file tabs.php.

$module = elgg_extract('module', $vars, 'tabs')

Definition at line 100 of file tabs.php.

foreach ($tabs as $index=> $tab) $tabs = (array) elgg_extract('tabs', $vars, [])

Definition at line 41 of file tabs.php.

if (!isset($vars['id'])) $vars['id'] = $id

Definition at line 37 of file tabs.php.

$vars['class'] = elgg_extract_class($vars, 'elgg-tabs-component')

Definition at line 39 of file tabs.php.