php/layouts/IndexLayout.php
public function addTabPanels( array $tabPanels ) {
		$tabItems = [];
		foreach ( $tabPanels as $i => $tabPanel ) {
			$this->tabPanels[ $tabPanel->getName() ] = $tabPanel;
			$labelElement = new Tag( 'span' );
			$tabItem = new TabOptionWidget( [
				'labelElement' => $labelElement,
				'label' => $tabPanel->getLabel(),
				'data' => $tabPanel->getName(),
				// Select the first item
				// TODO: Support selecting an arbitrary item
				'selected' => $this->tabSelectWidget->isEmpty() && $i === 0
			] );
			$tabItems[] = $tabItem;
		}
		$this->tabSelectWidget->addItems( $tabItems );
		$this->stackLayout->addItems( $tabPanels );
	}
public function addTabPanels( array $tabPanels ) {
		$tabItems = [];
		foreach ( $tabPanels as $i => $tabPanel ) {
			$this->tabPanels[ $tabPanel->getName() ] = $tabPanel;
			$labelElement = new Tag( 'span' );
			$tabItem = new TabOptionWidget( [
				'labelElement' => $labelElement,
				'label' => $tabPanel->getLabel(),
				'data' => $tabPanel->getName(),
				// Select the first item
				// TODO: Support selecting an arbitrary item
				'selected' => $this->tabSelectWidget->isEmpty() && $i === 0
			] );
			$tabItems[] = $tabItem;
		}
		$this->tabSelectWidget->addItems( $tabItems );
		$this->stackLayout->addItems( $tabPanels );
	}
public function addTabPanels ( array $ tabPanels ) { $ tabItems = [ ] ; foreach ( $ tabPanels as $ i => $ tabPanel ) { $ this -> tabPanels [ $ tabPanel -> getName ( ) ] = $ tabPanel ; $ labelElement = new Tag ( 'span' ) ; $ tabItem = new TabOptionWidget ( [ 'labelElement' => $ labelElement , 'label' => $ tabPanel -> getLabel ( ) , 'data' => $ tabPanel -> getName ( ) , // Select the first item // TODO: Support selecting an arbitrary item 'selected' => $ this -> tabSelectWidget -> isEmpty ( ) && $ i === 0 ] ) ; $ tabItems [ ] = $ tabItem ; } $ this -> tabSelectWidget -> addItems ( $ tabItems ) ; $ this -> stackLayout -> addItems ( $ tabPanels ) ; }
Add tab panels to the index layout

When tab panels are added with the same names as existing tab panels, the existing tab panels
will be automatically removed before the new tab panels are added.

@param TabPanelLayout[] $tabPanels Tab panels to add
Add tab panels to the index layout