PHP code example of gent-drupal / gent_base

1. Go to this page and download the library: Download gent-drupal/gent_base library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

gent-drupal / gent_base example snippets


/**
 * Implements hook_preprocess_HOOK() for html.
 */
function MYMODULE_preprocess_html(array &$variables) {
  // Check if the current page is using the admin theme.
  if (\Drupal::service('router.admin_context')->isAdminRoute()) {
    // Add a custom body class.
    $variables['attributes']['class'][] = 'cs--blue';
  }
}