The Aide module provides a simple utility class called Aide containing a collection of utility functions that handle common Drupal coding tasks.

The utility class is intended to be used within global functions (e.g. hooks, theme preprocessing, etc). This is because all of the utility functions are static, and they access Drupal services via the global service container. Please be aware of this when using the utility class. In the context of services and classes within modules, it is highly recommended to not use the utility class and to use dependency injection instead.

A more fitting solution for modules and backend work is being considered for the first official release.

Post-Installation

Enabling the Aide module does nothing by default. It is meant to enhance the developer experience and only exposes additional utility functions via code.

Functions

  • Aide::getCurrentPath() - Get the current path.
  • Aide::getRequestUri() - Get the request URI.
  • Aide::getCurrentRouteName() - Get the name of the current route.
  • Aide::getCurrentNode() - Extract node from the current route, if any.
  • Aide::getCurrentUser() - Get the current user.
  • Aide::getCurrentLanguage() - Get the current language.
  • Aide::getCurrentLanguageId() - Get the current language ID.
  • Aide::getTranslationFromContext($entity) - Get translation of an entity for the current context.
  • Aide::getBlock(machineName) - Returns the render array of the block with a given machine name.
  • Aide::getMenu(machineName) - Build the render array of a given menu via machine name.
  • Aide::getForm(class) - Build the render array of a given form via class name.
  • Aide::getImageInStyle(uri, style) - Get path to an image file, generated in a specified image style.
  • Aide::getResponsiveImageInfo(uri, style) - Get responsive image info for an image in a given responsive image style.
  • Project information

    • Project categories: Developer tools
    • Created by ksere on , updated
    • shieldStable releases for this project are covered by the security advisory policy.
      There are currently no supported stable releases.

    Releases