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

Breadcrumb

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

class RenderCallbacks

Same name in this branch
  1. 11.1.x core/modules/announcements_feed/src/RenderCallbacks.php \Drupal\announcements_feed\RenderCallbacks

Defines a class for render element callbacks.

@internal

Hierarchy

  • class \Drupal\navigation\RenderCallbacks

Expanded class hierarchy of RenderCallbacks

1 file declares its use of RenderCallbacks
NavigationHooks.php in core/modules/navigation/src/Hook/NavigationHooks.php

File

core/modules/navigation/src/RenderCallbacks.php, line 15

Namespace

Drupal\navigation
View source
final class RenderCallbacks {
    
    /**
     * Pre-render callback for layout builder.
     */
    public static function alterLayoutBuilder(array $element) : array {
        if (($element['#section_storage'] ?? NULL) instanceof NavigationSectionStorage) {
            // Remove add section links that exist before and after the existing
            // section.
            unset($element['layout_builder'][0], $element['layout_builder'][2]);
            // Remove add block link from the footer section and the remove and
            // configure buttons from the existing section.
            unset($element['layout_builder'][1]['remove'], $element['layout_builder'][1]['configure'], $element['layout_builder'][1]['layout-builder__section']['footer']['layout_builder_add_block']);
        }
        return $element;
    }

}

Members

Title Sort descending Modifiers Object type Summary
RenderCallbacks::alterLayoutBuilder public static function Pre-render callback for layout builder.

API Navigation

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