Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. MultiWidthLayoutBase.php

function MultiWidthLayoutBase::getDefaultWidth

Provides a default value for the width options.

Return value

string A key from the array returned by ::getWidthOptions().

1 call to MultiWidthLayoutBase::getDefaultWidth()
MultiWidthLayoutBase::defaultConfiguration in core/modules/layout_builder/src/Plugin/Layout/MultiWidthLayoutBase.php
Gets default configuration for this plugin.
2 methods override MultiWidthLayoutBase::getDefaultWidth()
ThreeColumnLayout::getDefaultWidth in core/modules/layout_builder/src/Plugin/Layout/ThreeColumnLayout.php
Provides a default value for the width options.
TwoColumnLayout::getDefaultWidth in core/modules/layout_builder/src/Plugin/Layout/TwoColumnLayout.php
Provides a default value for the width options.

File

core/modules/layout_builder/src/Plugin/Layout/MultiWidthLayoutBase.php, line 77

Class

MultiWidthLayoutBase
Base class of layouts with configurable widths.

Namespace

Drupal\layout_builder\Plugin\Layout

Code

protected function getDefaultWidth() {
    // Return the first available key from the list of options.
    $width_classes = array_keys($this->getWidthOptions());
    return array_shift($width_classes);
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal