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.
$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
.
Property | Type | Description | Required |
---|---|---|---|
elements | ContentElementInterface[] | The child elements | yes |
title | string | The title for the panel. | yes |
Get the child elements.
$elements = $panelElement->getElements();
Get the title for the panel.
$title = $panelElement->get( 'title' );
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 |
Get an associative array with all parameters.
$params = $panelElement->getParameters();
Retrieve a single parameter. Default should be provided.
$id = $panelElement->getParameter( 'id' [, $default ] );
$class = $panelElement->getParameter( 'class' [, $default ] );