You are here

public function DynamicLayoutForm::getWrapperClasses in Dynamic Layouts 8

1 call to DynamicLayoutForm::getWrapperClasses()
DynamicLayoutForm::addRowFormFields in src/Form/DynamicLayoutForm.php

File

src/Form/DynamicLayoutForm.php, line 373

Class

DynamicLayoutForm
Form controller for the DynamicLayout entity edit forms.

Namespace

Drupal\dynamic_layouts\Form

Code

public function getWrapperClasses() {
  $wrapper_classes_arr = [
    'container-fluid',
  ];

  /** @var \Drupal\dynamic_layouts\Entity\DynamicLayoutSettings $settings */
  $frontend_library_class = 'custom';
  if ($settings = $this->entityTypeManager
    ->getStorage('dynamic_layout_settings')
    ->load('settings')) {
    $frontend_library = $settings
      ->getFrontendLibrary();
    if ($frontend_library == 'bootstrap') {
      $wrapper_classes_arr[] = $frontend_library_class . '-12';
    }
    else {
      if ($column_count = $settings
        ->getGridColumnCount()) {
        $wrapper_classes_arr[] = $frontend_library . '-' . $column_count;
      }
    }
  }
  $wrapper_classes_arr[] = $frontend_library_class;
  return implode(' ', $wrapper_classes_arr);
}