You are here

reviews.module in Reviews 1.0.x

Same filename and directory in other branches
  1. 7 reviews.module

Contains reviews.module.

File

reviews.module
View source
<?php

/**
 * @file
 * Contains reviews.module.
 */
use Drupal\Core\Render\Element;
function template_preprocess_review(&$variables) {

  // Helpful $content variable for templates.
  $variables['content'] = [];
  foreach (Element::children($variables['elements']) as $key) {
    $variables['content'][$key] = $variables['elements'][$key];
  }
}

/**
 * Implements hook_theme().
 */
function reviews_theme($existing, $type, $theme, $path) {
  return [
    'review' => [
      'render element' => 'elements',
    ],
    'no_reviews' => [
      'render element' => 'elements',
    ],
  ];
}

Functions