Skip to content

Latest commit

 

History

History
81 lines (50 loc) · 1.77 KB

Panel.md

File metadata and controls

81 lines (50 loc) · 1.77 KB

◄ Back to index

Panel icon Joomla\Content\Element\Panel

A panel is a particular arrangement of information grouped together for presentation to users in a window or pop-up.

From Wikipedia

Panels are used to add a title to a group of elements for use in collections, like Accordion or Tabs.

Usage

$panelElement = new Panel( ContentElementInterface[] $elements, string $title [, array $params ] );

or

$panelElement = Panel::from( ContentElementInterface $data [, array $mapping [, array $params ] ] );

data or params must contain values for the required constructor argument title.

Properties

Property Type Description Required
elements ContentElementInterface[] The child elements yes
title string The title for the panel. yes

Elements

Get the child elements.

$elements = $panelElement->getElements();

Title

Get the title for the panel.

$title = $panelElement->get( 'title' );

Parameters

Parameters are optional settings for the presentation. All elements can have 'id' and 'class' parameters; other depend on environment and/or renderer.

Parameter Type Description
id string The ID of the element
class string CSS class

Parameter List

Get an associative array with all parameters.

$params = $panelElement->getParameters();

Single Parameter

Retrieve a single parameter. Default should be provided.

$id    = $panelElement->getParameter( 'id' [, $default ] );
$class = $panelElement->getParameter( 'class' [, $default ] );

Examples