function template_preprocess_log_add_list in Log entity 8
Prepares variables for list of available log type templates.
Default template: log-add-list.html.twig.
Parameters
array $variables: An associative array containing:
- content: An array of content types.
See also
log_add_page()
File
- ./
log.module, line 77 - Contains log.module..
Code
function template_preprocess_log_add_list(array &$variables) {
$variables['types'] = array();
if (!empty($variables['content'])) {
foreach ($variables['content'] as $type) {
$variables['types'][$type
->id()] = array(
'type' => $type
->id(),
'add_link' => \Drupal::l($type
->label(), new Url('log.add', array(
'log_type' => $type
->id(),
))),
);
}
}
}