public function ResultsController::results in Rate 8
Display rate voting results views.
Parameters
\Drupal\node\NodeInterface $node: The node for which to display results.
Return value
array The render array.
1 string reference to 'ResultsController::results'
File
- src/
Controller/ ResultsController.php, line 23
Class
- ResultsController
- Returns responses for Rate routes.
Namespace
Drupal\rate\ControllerCode
public function results(NodeInterface $node) {
// First, make sure the data is fresh.
$cache_bins = Cache::getBins();
$cache_bins['data']
->deleteAll();
// Get and return the rate results views.
$page[] = views_embed_view('rate_results', 'results_block', $node
->id(), 'node');
$page[] = views_embed_view('rate_results', 'summary_block', $node
->id(), 'node');
return $page;
}